Oleg Verych <[EMAIL PROTECTED]> wrote:
> 
> == Proposition A. Do not implement `-a' and `-o'. ==

I sympathise with your view Oleg.  Indeed, if you raised this
a few years back I'd have removed it with no hesitation :)

Unfortunately these days there are too many systems that already
use dash out there (mostly Debian + Ubuntu) that have loads of
scripts on them that use -a or -o.

There's no way that we can get away with just breaking these
scripts.
 
> == Proposition B. Extend `-ot' and `-nt' to check a list of files. ==
> 
> This are not POSIX ops, described in [0] as to be not included from
> original KornShell, due to not including `[[' semantics.
> 
> Nonetheless, they are present in `dash` and in other implementations.
> Maybe because of [0]:
> 
>     Additional implementation-defined operators and primary_operators
>     may be provided by implementations. They shall be of the form -
>     operator where the first character of operator is not a digit.
> 
> Now, i want to add something like this:
> 
> #!/bin/dash
> cd /mnt/path/to/src
> 
> test file.c -ot [ utils/foo.c include/bar.h ] && do_update
> [ file.c -nt [ utils/foo.c include/bar.h ] ]  || do_nothing
> 
> test vmlinux.o -nt [ $DEP_LIST ] || do_something

It looks neat but I'm not convinced that we need this feature.
I have two reasons for this:

1) This can just as easily be done in a script:

{ [ file.c -ot utils/foo.c ] || [ file.c -ot include/bar.h ]; } &&
        do_update

{ [ file.c -nt utils/foo.c ] && [ file.c -nt include/bar.h ]; } ||
        do_nothing

for i in $DEP_LIST; do
        [ vmlinux.o -nt "$i" ] || ! break
done || do_something

You can probably write a shell function that implemented this
in the syntax you want.

2) POSIX does not require this.

In other words, I would consider a new feature for dash if it
is either required by POSIX or if it's useful enough and that
it can't easily be done using existing shell primitives.

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to