From owner-freebsd-questions@FreeBSD.ORG Sat May 17 07:55:29 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BCE5837B401 for ; Sat, 17 May 2003 07:55:29 -0700 (PDT) Received: from doriath.saers.com (doriath.religion.no [193.156.192.198]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CE4A43F93 for ; Sat, 17 May 2003 07:55:29 -0700 (PDT) (envelope-from niklasmls@doriath.saers.com) Received: by doriath.saers.com (Postfix, from userid 1001) id C3403420B; Sat, 17 May 2003 16:55:27 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by doriath.saers.com (Postfix) with ESMTP id BD35A3E82 for ; Sat, 17 May 2003 16:55:27 +0200 (CEST) Date: Sat, 17 May 2003 16:55:27 +0200 (CEST) From: Niklas Saers Mailinglistaccount To: FreeBSD-Questions@freebsd.org Message-ID: <20030517164813.V37832@doriath.saers.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: bash shell for-loop X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2003 14:55:30 -0000 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