Answers for "scrpti shell split string"

1

split string in shell script

IN="[email protected];[email protected]"
arrIN=(${IN//;/ })
echo ${arrIN[1]}                  # Output: [email protected]
Posted by: Guest on November-23-2021
0

split sh string

#YOURSTRING="this_is_an_example"
#output:
#this
#is
#an
#example
for i in $(echo $YOURSTRING | tr "_" "\n")
do
	echo $i
done
Posted by: Guest on June-14-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language