Shell Script: split string using cut








# the string is dot separated.
a=1a.2b.3c.4d.5e.6f

# split it and prints 6th column
echo $a | cut -d'.' -f6 

# prints 6f


See Also: [Shell Script: Split String Using tr and awk]


No comments:

Post a Comment