bash shell for-loop

Raphaël Marmier raphael at
Sat May 17 12:44:53 PDT 2003

Looks like it stop to ask fo the password...


Le samedi, 17 mai 2003, à 16:55 Europe/Zurich, Niklas Saers 
Mailinglistaccount a écrit :

> Hi,
> I've created a small bash script that stops, and I cannot understand 
> why
> it stops. It is:
> #!/usr/local/bin/bash
> for username in $(ls /home); do
>   su -m $username /home/$username/;
> done
> When I type this at the bash prompt, it goes well. However, when I call
> this script it executes the first su and then gives me:
> [4]+  Stopped                 bash /tmp/
> Why does it stop? I've nowhere asked it to stop. I certainly don't 
> want it
> to stop.
> To explain my command, I start a set of daemons for each user 
> specified in
> ~/ and no user has a valid shell as I do not wish to allow 
> them
> any kind of login access. Thus I have to include the "-m"
> What makes a bash script stop? How can I set it to ignore whatever is
> requesting it (errorlevels?) to stop?
> Cheers
>   Nik
> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to 
> "freebsd-questions-unsubscribe at"

More information about the freebsd-questions mailing list