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 225 views
1 answer 243 views
1 answer 133 views
133 views asked Aug 9, 2024 by avibootz
2 answers 568 views
2 answers 346 views
1 answer 246 views
1 answer 246 views
...