On Wed, May 04, 2005 at 11:39:55AM -0700, Jason Van Cleve wrote:
> Quoth Jacob Meuser, on Tue, 3 May 2005 22:56:30 -0700:
>
> > #!/bin/sh
> >
> > set -e
> >
> > : ${CPMV:=mv}
> >
> > FILE="`pwd`/$1"
> >
> > cp ${FILE} ${FILE}.orig
> >
> > sed -e 's,// *\(.*\),/* \1 */,g' ${FILE} > ${FILE}.sed
> > ${CPMV} ${FILE}.sed ${FILE}
> >
> > indent ${FILE} ${FILE}.indent -di8 -dj0 -nfc1 -i4
> > ${CPMV} ${FILE}.indent ${FILE}
> >
> > exit 0
>
> Whoa. This code frightens me. What does
>
> > : ${CPMV:=mv}
>
> mean?
from `man sh`
${name:=word}
If `name' is set and not NULL, it is substituted; otherwise, it it
assigned `word' and the resulting value of `name' is substituted.
the leading ':' (null command) lets this work with 'set -e', but I forget
the exact reason it's needed, perhaps the test if `name' is NULL?
> Also, indent appears to be geared for C specifically,
yes.
> and I'm
> looking for something more general. lint is not on my system, and I
lint is C only also.
> don't know which package contains it. And (un)expand is good to know
> about but not what I need.
those are the tools I use when I need them. as the others said,
there's always sed and perl.
--
<[EMAIL PROTECTED]>
_______________________________________________
EUGLUG mailing list
[email protected]
http://www.euglug.org/mailman/listinfo/euglug