![]() |
|
"be consistent" | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
How about echo $variable | perl -nae 'print $a[0]' or possibly perl -e 'print((split /\s+/, "'$variable'")[0])' ?
Update: Very many thanx to LanX - modifed 2nd suggestion to correct parenthesis, but ignored nested quotes comment since they are most definitely deliberate - without them, perl would split the string '$variable' whereas with them, the shell expands the shell variable and perl then splits that string.
A user level that continues to overstate my experience :-))
In reply to Re: Simple awk question
by Bloodnok
|
|