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

2011-05-28 Thread Chet Ramey
On 5/27/11 3:35 PM, Jacoby Hickerson wrote: > Bash Version: 4.2 > Patch Level: 10 > Release Status: release > > Description: > When executing a test script using the #!/bin/sh interpreter line > the shell expansion for the last argument ${!#} is blank, > however when using #!/bin/

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: 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