bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Q: bash parameter expansion


From: Dmitry V. Levin
Subject: Q: bash parameter expansion
Date: Mon, 21 Apr 2008 05:44:40 +0400

Hi,

I wonder whether such difference in parameter expansion is valid:

$ env -i sh -c 'fun() { echo "[${*#foo }]"; }; fun foo bar'
[foo bar]
$ env -i sh -c 'fun() { echo "[${*#foo}]"; }; fun foo bar'
[ bar]
$ sh --version
GNU bash, version 3.2.33(1)-release (x86_64-alt-linux-gnu)
Copyright (C) 2007 Free Software Foundation, Inc.

Unlike bash, dash demonstrates no such difference:

$ env -i ash -c 'fun() { echo "[${*#foo }]"; }; fun foo bar'
[bar]
$ env -i ash -c 'fun() { echo "[${*#foo}]"; }; fun foo bar'
[ bar]


-- 
ldv

Attachment: pgpVS2q3nBzrU.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]