Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

May 292014

Use Perl to split string instead of awk


If you know Perl well, there is no need to use awk to do string processing such as string splitting, it is easy with Perl also, e.g.

# echo "foo,bar,k3"  | perl -F',' -lane 'print $F[1]'

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>