From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ms-smtp-04-smtplb.ohiordc.rr.com ([65.24.5.138] helo=ms-smtp-04-eri0.ohiordc.rr.com) by speech.braille.uwo.ca with esmtp (Exim 3.36 #1 (Debian)) id 1ECI6t-0000nv-00 for ; Mon, 05 Sep 2005 10:38:11 -0400 Received: from [192.168.1.100] (cpe-24-33-4-163.midsouth.res.rr.com [24.33.4.163]) by ms-smtp-04-eri0.ohiordc.rr.com (8.12.10/8.12.7) with ESMTP id j85Ec8HI025307 for ; Mon, 5 Sep 2005 10:38:08 -0400 (EDT) Date: Mon, 5 Sep 2005 09:38:08 -0500 (CDT) From: Adam Myrow To: "Speakup is a screen review system for Linux." In-Reply-To: <20050905115645.GA3629@lnx3.holmesgrown.com> Message-ID: References: <20050905115645.GA3629@lnx3.holmesgrown.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Symantec AntiVirus Scan Engine Subject: Re: preventing slackware services from auto starting X-BeenThere: speakup@braille.uwo.ca X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Speakup is a screen review system for Linux." List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Sep 2005 14:38:11 -0000 On Mon, 5 Sep 2005, Steve Holmes wrote: > Why is that first period necessary? I've seen that from time to time in > Slackware startup scripts but I never knew why and when I've added > commands to my own startup scripts, I usually leave it out with no known > effects. I don't know if it's strictly necessary, but it does change the behavior. Normally, if you execute a shell script by typing its name, it will run in a subshell, which will be determined by the "#!" line at the top of the script. For example, if the top line says "#!/bin/sh," it runs in /bin/sh, which is normally a symbolic link to Bash under Linux. If, on the other hand, you invoke the script with a period by itself at the beginning of the line, the script runs in the current shell, and the "#!" line is treated as a comment and ignored. This is how .profile is ran at login. This has both advantages and disadvantages. The obvious disadvantage is that if the script is intended for Perl, or Tcsh, it will bomb out with this method since the current shell tries to interpret it. The big advantage is that any environment variables you set will remain after the script quits. That's why export commands in your .profile will work, but if you try them in another script, and invoke it without the period, they will vanish once the script exits. Exported variables are available to child shells, but not parent shells. This makes it very difficult to pass variables from a script back to the parent shell, unless you source it so that it runs in the current shell. Hope this explains it clearly. My suspicion is that Slackware is sourcing the other startup scripts in order to keep the number of processes down at boot time.