From: J G Miller on
On Sat, 03 Oct 2009 20:20:03 +0000, The Doctor wrote:

> I think you misspelled bash .

What do you see if you enter the command on your system

ls -l /bin/sh

From: Chris F.A. Johnson on
On 2009-10-03, J G Miller wrote:
> On Sat, 03 Oct 2009 18:48:08 +0000, Chris F.A. Johnson wrote:
>
>> TTYNUM=${TTY##*[^0-9]}
>
> Yes that is much simpler but it is a Bashism which will not work under
> Bourne shell (or /bin/dash) and is therefore not portable.

It is not a bashism. It will work in any POSIX shell (which
includes dash).


--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
From: Dave Gibson on
[Followup-To: header set]

Chris F.A. Johnson <cfajohnson(a)gmail.com> wrote:
> On 2009-10-03, J G Miller wrote:
>> On Sat, 03 Oct 2009 18:48:08 +0000, Chris F.A. Johnson wrote:
>>
>>> TTYNUM=${TTY##*[^0-9]}
>>
>> Yes that is much simpler but it is a Bashism which will not work under
>> Bourne shell (or /bin/dash) and is therefore not portable.
>
> It is not a bashism. It will work in any POSIX shell (which
> includes dash).

Replace the '^' with a '!' for POSIX shells.

TTYNUM=${TTY##*[!0-9]}