Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 May 2003 01:10:21 +0200 (CEST)
From:      Niklas Saers Mailinglistaccount <niklasmls@doriath.saers.com>
To:        =?ISO-8859-1?Q?Rapha=EBl_Marmier?= <raphael@computer-rental.ch>
Cc:        FreeBSD-Questions@freebsd.org
Subject:   Re: bash shell for-loop
Message-ID:  <20030518010947.U37832@doriath.saers.com>
In-Reply-To: <F8AA746A-889F-11D7-A528-000393D67E4A@computer-rental.ch>
References:  <F8AA746A-889F-11D7-A528-000393D67E4A@computer-rental.ch>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

On Sat, 17 May 2003, [ISO-8859-1] Rapha=EBl Marmier wrote:
> Looks like it stop to ask fo the password...

not really, I type "fg" and it continues, then stopping again before
redoing the loop

Cheers

  Nik

>
> Raphael
>
> Le samedi, 17 mai 2003, =E0 16:55 Europe/Zurich, Niklas Saers
> Mailinglistaccount a =E9crit :
>
> > 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/startup.sh;
> > 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/sh.sh
> >
> > 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
> > ~/startup.sh 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@freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> > To unsubscribe, send any mail to
> > "freebsd-questions-unsubscribe@freebsd.org"
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030518010947.U37832>