Need a command or script

Eric Shubert ejs at shubes.net
Thu Dec 4 19:10:00 MST 2008


Dazed_75 wrote:
>> 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.

That's correct.

> The error processing is a good addition.

Just a simple sanity check. ;) Could be more elaborate I suppose.

> Larry

Let me know how you like it. I think it's pretty straight forward.

-- 
-Eric 'shubes'



More information about the PLUG-discuss mailing list