pwd as first command changes script behavior

2011-09-01 Thread Quiring, Sam
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAG

RE: pwd as first command changes script behavior

2011-09-01 Thread Quiring, Sam
Hi Jonathan, Thanks for taking the time. I get it now. I am sorry to have bothered you -Sam -Original Message- From: Jonathan Nieder [mailto:jrnie...@gmail.com] Sent: Thursday, September 01, 2011 2:27 PM To: Quiring, Sam Cc: bug-bash@gnu.org; b...@packages.debian.org Subject: Re: pwd

Re: pwd as first command changes script behavior

2011-09-01 Thread Jonathan Nieder
Hi Sam, Quiring, Sam wrote: > #! /bin/bash > pwd > echo $_ > > #! /bin/bash > echo $_ > pwd > > The first one displays: > /home/windriver/changes/NexS-235r1/with-camera > pwd > > The second one displays: > ./apply.sh > /home/windriver/changes/NexS-235r1/with-camera That's what $_ is advertised t

Re: Special parameter $_ expands to a relative path

2011-09-01 Thread Angel Tsankov
On 09/01/11 15:11, Greg Wooledge wrote: On Thu, Sep 01, 2011 at 01:15:34AM -0800, Roger wrote: [...] The original poster may be interested in this page: http://mywiki.wooledge.org/BashFAQ/028 -- How do I determine the location of my script? I want to read some config files from the same place

Re: Special parameter $_ expands to a relative path

2011-09-01 Thread Greg Wooledge
On Thu, Sep 01, 2011 at 01:15:34AM -0800, Roger wrote: > MAILPATH > A colon-separated list of file names to be checked for mail. > The message to be printed when mail arrives in a particular file > may be specified by separating the file name from the message > with

Re: Special parameter $_ expands to a relative path

2011-09-01 Thread Roger
> On Thu, Sep 01, 2011 at 09:35:14AM +0300, Angel Tsankov wrote: >Hello, > >The Bash Reference Manual >(http://www.gnu.org/s/bash/manual/bash.html#Special-Parameters) says: > >At shell startup, [$_ is] set to the absolute pathname used to invoke >the shell or shell script being executed as passed