Re: Need a command or script

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Dazed_75
Date:  
To: Main PLUG discussion list
Subject: Re: Need a command or script
>
> 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
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss