I have to split a string in a bash script by "/" but I tried:
for i in $(echo $www | tr "/")
But it did not work, any suggestion ?
Thanks a lot.
Your trick would work, if you would tell tr
, what slash should be translated into:
for w in $(echo "what/the/heck" | tr "/" " ") ; do echo $w; done
what
the
heck
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With