quarta-feira, 13 de julho de 2011

Shell: Skip First Two Fields and Print the Rest of Line

Using awk:
$ echo 'This is a test blah foo bar etc' | awk '{print substr($0, index($0,$3))}'
a test blah foo bar etc

Using cut:
$ echo 'This is a test blah foo bar etc' | cut -d ' ' -f3-
a test blah foo bar etc

Nenhum comentário:

Postar um comentário

Drunk Penguins

Drunk Penguins
Drunk Penguins