codesnips’s posterous

« Back to blog

[Ruby] Cut with ruby

ruby -a -ne 'puts $F[1], $F[2]'


-a will split the input into an array called $F. The above will print the second and the third item of the array (based on 0 index)

Comments (0)

Leave a comment...

 
To leave a comment on this posterous, please login by clicking one of the following.
Posterous-login     Connect     twitter