Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

split string using linux cmd

$ s='one_two_three_four_five'

$ A="$(cut -d'_' -f2 <<<"$s")"
$ echo "$A"
two

$ B="$(cut -d'_' -f4 <<<"$s")"
$ echo "$B"
four
Source by unix.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #split #string #linux #cmd
ADD COMMENT
Topic
Name
7+4 =