How to print all the words from a string in Bash

1 Answer

0 votes
S="bash python java c c++ c#"

for word in $S
do
   echo "$word"
done
 
    
    
    
    
# run:
#
# bash
# python
# java
# c
# c++
# c#
#

 



answered May 27, 2021 by avibootz

Related questions

1 answer 339 views
1 answer 352 views
1 answer 245 views
245 views asked Aug 9, 2024 by avibootz
2 answers 736 views
2 answers 493 views
1 answer 384 views
1 answer 360 views
...