Re: Tests [ 0 -eq $UID ] don't work as in bash

2016-09-07 Thread Paul Smith
On Wed, 2016-09-07 at 16:44 +0200, Andrey Voropaev wrote: > if [ 0 -eq $UID ] The variable UID is not defined to be automatically set by the shell in POSIX; having it set is a bash extension.  dash doesn't set it automatically for you. You'll have to set it yourself:   UID=$(id -u) Also you

Re: Failure of nested substring processing inside double-quotes

2014-10-07 Thread Paul Smith
On Wed, 2014-10-08 at 10:28 +0800, Herbert Xu wrote: This is already fixed in the current git tree, by the commit: Thanks Herbert! I should have checked Git. I did check Debian and the current dash in stable and sid all still have this issue. The version in experimental, however,

Failure of nested substring processing inside double-quotes

2014-10-06 Thread Paul Smith
Hi all. I recently found a bug in dash's handling of substring processing, when the variable is contained within quotes. In bash, this works: bash$ echo $PWD /home/psmith bash$ echo ${PWD%${PWD##*/}}. /home/. bash$ echo ${PWD%${PWD##*/}}. /home/. which is what I expect. However,

Re: [PATCH] Allow == as synonym for = in test

2011-03-08 Thread Paul Smith
On Tue, 2011-03-08 at 09:17 +0200, Dan Muresan wrote: Wherever Linux goes, bash goes too... except for embedded busyboxy systems, where everything is customized by hand anyway. No one ever said you couldn't write shell scripts in bash rather than in sh, even on Ubuntu. You just have to use