alex lupu wrote: > On Fri, Oct 11, 2013 at 10:48 PM, Bruce Dubbs <bruce.du...@gmail.com> wrote: > >>>> alex lupu wrote: >> > >> ... > []$ cat tempx.txt | awk 'BEGIN {FS=".so"} ; {print $1}' > >> ... > >> Is there a problem with GNU gawk and/or my system or maybe with me? > > >>> You. >>> echo libsndfile.so.1.0.25 | sed -r 's/(.*)\.so.*/\1/' >>> Or >>> for f in `cat tempx.txt`; do echo $f | sed -r 's/(.*)\.so.*/\1/'; done >> >> Hi Bruce, > > The subject question has been, is there a bug in gawk? > > As I showed, gawk can take a bunch of characters as field separator: > > awk 'BEGIN {FS="YYY"} ; {print $1}' ... > > but NOT > > awk 'BEGIN {FS=".so"} ; > > NOR > > awk 'BEGIN {FS="\.so"}
See if awk 'BEGIN {FS="\\.so"}... works for you. http://www.gnu.org/software/gawk/manual/html_node/Field-Splitting-Summary.html First paragraph. -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page