Need a command or script

Dazed_75 lthielster at gmail.com
Thu Dec 4 18:25:20 MST 2008


>
> Again, if there are no spaces in the file names, you might do something
> like:
>
> newfile=mynewfile
> oldfile=myoldfile
> rm $newfile
> while read cmd arg1 arg2 rest_of_line; do
>   if [ -z "$rest_of_line" ] && [ ! -z "$arg2" ]; then
>     echo "$cmd $arg2 $arg1" >>$mynewfile
>   else
>     echo "bypassed: $cmd $arg1 $arg2 $rest_of_line"
>   fi
> done < $myoldfile
>
> 'nuf sed. ;)
>
> --
> -Eric 'shubes'
>
>
Eric,

I have not tried this yet, but reading it looks like it is intended to
be a script file which one would edit to replace the first two lines
with the real file names and then run it.  The error processing is a
good addition.

Larry
-- 
Man is the only animal that laughs and weeps, for he is the only
animal that is struck with the difference between what things are and
what they ought to be.
  - William Hazlitt


More information about the PLUG-discuss mailing list