alex lupu wrote:
>> Bruce wrote:
>> See if awk 'BEGIN {FS="\\.so"}...  works for you.
>
> Hi Bruce,
>
> It DOES !!!
> Thank you very much!
>
> As an aside, (to explain) why _I_ prefer 'awk' to 'sed' _in this case:
>
> for f in `cat tempx.txt`; do echo $f | sed -r 's/(.*)\.so.*/\1/'; done
>
> vs.
>
>   cat tempx.txt | awk 'BEGIN {FS="\\.so"} ; {print $1}'

awk is very powerful, but generally useful in more complex cases.  It 
also has a bit more overhead than sed.  If I can do it in one line with 
sed, that is my preference.

Come to think of it, I generally will use php instead of awk for those 
more complex needs.  That's much more powerful and the code is easier to 
understand.

   -- Bruce

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to