Re: Need a command or script

Page principale
Attachements:
Message en tant que courrier électronique
+ (text/plain)
Supprimer ce message
Répondre à ce message
Auteur: Dazed_75
Date:  
À: Main PLUG discussion list
Sujet: 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