Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash iterate over a list

#!/bin/bash
StringVal="Welcome to linux"

for val in $StringVal; do
    echo $val
done

# Output: 
# Welcome
# to
# linux
 
PREVIOUS NEXT
Tagged: #bash #iterate #list
ADD COMMENT
Topic
Name
9+3 =