Re: Need a command or script

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: Eric Shubert
日付:  
To: plug-discuss
題目: Re: Need a command or script
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'

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss