Need a command or script

Eric Shubert ejs at shubes.net
Tue Dec 2 18:05:31 MST 2008


Dazed_75 wrote:
> Gotcha
> 
> I may have time to try this at the meeting if I get set up quickly
> enough.  Yes, I was confused by that.  Still want to go back and
> review sed though.
> 
> Thanks again!!
> 
> 
> Larry Thiel

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'



More information about the PLUG-discuss mailing list