Re: last argument expansion has different output using the sh interpreter

2011-05-27 Thread Jacoby Hickerson
On Fri, 2011-05-27 at 14:57 -0600, Bob Proulx wrote: > Jacoby Hickerson wrote: > > Although, I am curious, is this is a matter of sh being continually > > updated to exclude all bash extensions or perhaps previously bash > > didn't interpret #!/bin/sh to be the POSIX compliant interpreter? > > Whe

Re: last argument expansion has different output using the sh interpreter

2011-05-27 Thread Jacoby Hickerson
On Fri, 2011-05-27 at 16:53 -0400, Greg Wooledge wrote: > On Fri, May 27, 2011 at 01:35:50PM -0700, Jacoby Hickerson wrote: > > Although, I am curious, is this is a matter of sh > > being continually updated to exclude all bash extensions > > Eh? POSIX is defined by a group of people and publishe

Re: edit-and-execute-command is appropriately named, weird

2011-05-27 Thread David Thomas
Hi Chet, Thank you for the response, and the attempt at assistance. I was unaware of the POSIX specifications relating to editing modes. After reading the specs, however, I don't think they conflict with what I propose. While the description of the [count]v command does say that it executes the

Re: last argument expansion has different output using the sh interpreter

2011-05-27 Thread Bob Proulx
Jacoby Hickerson wrote: > Although, I am curious, is this is a matter of sh being continually > updated to exclude all bash extensions or perhaps previously bash > didn't interpret #!/bin/sh to be the POSIX compliant interpreter? When bash is invoked as sh then bash complies with the POSIX sh. Th

Re: last argument expansion has different output using the sh interpreter

2011-05-27 Thread Greg Wooledge
On Fri, May 27, 2011 at 01:35:50PM -0700, Jacoby Hickerson wrote: > Although, I am curious, is this is a matter of sh > being continually updated to exclude all bash extensions Eh? POSIX is defined by a group of people and published. Here's the current edition: http://pubs.opengroup.org/onlinep

Re: last argument expansion has different output using the sh interpreter

2011-05-27 Thread Andreas Schwab
DJ Mills writes: > The only way I can think of to get the last argument in sh is to loop > through them, > something like: > for arg; do last="$arg"; done; echo "$last" $ eval echo \"\${$#}\" Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D

Re: last argument expansion has different output using the sh interpreter

2011-05-27 Thread Jacoby Hickerson
On Fri, May 27, 2011 at 1:20 PM, DJ Mills wrote: > > > On Fri, May 27, 2011 at 3:45 PM, Greg Wooledge wrote: > >> On Fri, May 27, 2011 at 12:35:12PM -0700, Jacoby Hickerson wrote: >> > When executing a test script using the #!/bin/sh interpreter >> line >> > the shell expansion for the la

Re: last argument expansion has different output using the sh interpreter

2011-05-27 Thread DJ Mills
On Fri, May 27, 2011 at 3:45 PM, Greg Wooledge wrote: > On Fri, May 27, 2011 at 12:35:12PM -0700, Jacoby Hickerson wrote: > > When executing a test script using the #!/bin/sh interpreter line > > the shell expansion for the last argument ${!#} is blank, > > Good. And now you know why you

Re: last argument expansion has different output using the sh interpreter

2011-05-27 Thread Greg Wooledge
On Fri, May 27, 2011 at 12:35:12PM -0700, Jacoby Hickerson wrote: > When executing a test script using the #!/bin/sh interpreter line > the shell expansion for the last argument ${!#} is blank, Good. And now you know why you use a proper #!/bin/bash shebang when you use bash extensions in

last argument expansion has different output using the sh interpreter

2011-05-27 Thread Jacoby Hickerson
I tried to send this using bash-bug, however I didn't realize my sendmail was not setup, so here is the description in the format of bash-bug. Bash Version: 4.2 Patch Level: 10 Release Status: release Description: When executing a test script using the #!/bin/sh interpreter line the shell

Re: a "script-relative" version of env

2011-05-27 Thread Bob Proulx
E R wrote: > - I've noticed that the argument passed to the she-bang interpreter > always seems to be an absolute path when commands are executed from a > shell. Are there cases where that will not be true? You might find reading Sven Mascheck's documentation interesting: http://www.in-ulm.de/

a "script-relative" version of env

2011-05-27 Thread E R
Hi all, This is not a bash bug, but I am hoping the people on this list would find the question interesting... I have found it useful to have a "script-relative" version of /usr/bin/env. Whereas env determines an interpreter's location based on PATH, this version would determine the interpreter's