Answers for "bash split params"

1

How to split a string in bash

string="you got a friend in me"
IFS=' ' read -ra split <<< "$string"
echo "${split[*]}"
# Output: you got a friend in me
echo "${split[3]}"
# Output: friend
Posted by: Guest on March-14-2022
1

split bash string

IN="[email protected];[email protected]"
arrIN=(${IN//;/ })
Posted by: Guest on April-29-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language