Medieval Shells

[prev] [thread] [next] [lurker] [Date index for 2006/12/19]

From: dom (Dominic Mitchell)
Subject: Medieval Shells
Date: 11:55 on 19 Dec 2006
On Tue, Dec 19, 2006 at 02:43:57AM +0100, A. Pagaltzis wrote:
> * Peter da Silva <peter@xxxxxxx.xxx> [2006-12-18 22:15]:
> > Wouldn't this solve the original problem?
> 
> Not only would it solve it, it actually works better: you don't
> need to terminate any process in order to recover the disk space
> occupied by files it has opened.
> 
> > #!/bin/sh
> > 
> > # purge - really remove a file!
> > 
> > for i
> > do [ -f $i ] && > $i
> > done
> > exec rm ${1+"$@"}
> 
>     #!/bin/sh
>     tee ${1+"$@"} < /dev/null
>     exec rm ${1+"$@"}

Why-oh-why are vile constructs like ${1+"$@"} still being used?  This
isn't 1985 any more.  In any modern shell that you're likely to come
across[1], plain "$@" will work just fine.

-Dom, hating the "must work in 7th Edition" line of shell scripters.

[1] Don't get started on all that tcsh shite again...
There's stuff above here

Generated at 03:01 on 20 Dec 2006 by mariachi 0.52