You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser.
How split a string in Linux?
How split a string in Linux?
Answer
Example 3: Bash Split String using Trim Command
- #!/bin/bash.
- #Example to split a string using trim (tr) command.
- my_str=”We;welcome;you;on;javatpoint.”
- my_arr=($(echo $my_str | tr “;””n”))
- for i in “${my_arr[@]}”
- do.
- echo $i.
- done.