from the doc:
-Fpattern split() pattern for autosplit (-a)
@ubuntu:~$ ruby -an -F -e 'puts $_;puts $_.split; puts $F[3] if /^a/'
a fdrvo hhl vgtl bbnn
a fdrvo hhl vgtl bbnn
a
fdrvo
hhl
vgtl
bbnn
vgtl
@ubuntu:~$ ruby -an -e 'puts $_;puts $_.split; puts $F[3] if /^a/'
aaas kgkb hv njjj jlh
aaas kgkb hv njjj jlh
aaas
kgkb
hv
njjj
jlh
njjj
As the output is same for both the code thus couldn’t understand the actual use of -F<pat> in ruby. Can anyone help me here ?
Thanks
Try this:
The pattern after
-F(‘p’ in this case) is used as the separator instead of a blank space.