Hello Alexandre,

perhaps I'm missing the context in which is mdate-sh executed, but
couldn't a file name with a space appear there?

On Sun, Feb 06, 2005 at 05:27:35PM +0100, Alexandre Duret-Lutz wrote:
> # On a POSIX system, we should have
> #
> # $# = 5
> # $1 = file size
> # $2 = month
> # $3 = day
> # $4 = year or time
> # $5 = filename
> #
> # On Darwin 7.7.0 and 7.6.0, we have
> #
> # $# = 4
> # $1 = day
> # $2 = month
> # $3 = year or time
> # $4 = filename
...
> case $# in
>  4) day=$1;;
>  *) day=$3; shift;;
> esac

Wouldn't the following be safer:

case $3 in
  ???*) day=$1;;
  *) day=$3; shift;;
esac

Have a nice day,
        Stepan Kasal


Reply via email to