Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

loop over array of strings bash

## declare an array variable
declare -a arr=("element1" "element2" "element3")

## now loop through the above array
for i in "${arr[@]}"
do
   echo "$i"
   # or do whatever with individual element of the array
done

# You can access them using echo "${arr[0]}", "${arr[1]}" also
Comment

bash for loop string array

## declare an array variable
declare -a arr=("element1" "element2" "element3")

## now loop through the above array
for i in "${arr[@]}"
do
   echo "$i"
   # or do whatever with individual element of the array
done
Comment

Loop through an array of strings in Bash

## declare an array variable
declare -a arr=("element1" "element2" "element3")

## now loop through the above array
for i in "${arr[@]}"
do
   echo "$i"
   # or do whatever with individual element of the array
done

# You can access them using echo "${arr[0]}", "${arr[1]}" also
Comment

PREVIOUS NEXT
Code Example
Shell :: master to main github 
Shell :: git delete stash 
Shell :: npm install -g express 
Shell :: redis reload config 
Shell :: how to merge branches github 
Shell :: ubuntu dotnet 6 
Shell :: change default terminal linux 
Shell :: git force add 
Shell :: copy paste in git bash 
Shell :: pip install kivy 
Shell :: how to open a file using terminal 
Shell :: git reset specific file 
Shell :: how to print new line in shell script 
Shell :: ansible run multiple shell commands 
Shell :: enable mods 
Shell :: ubuntu create bootable usb from iso command line 
Shell :: open directory windows command 
Shell :: intel pinning threads 
Shell :: [Thu Nov 5 15:20:23 2020] Failed to listen on localhost:3200 (reason: Address already in use) 
Shell :: install ubuntu on wsl 
Shell :: remove file from commit 
Shell :: return boolean bash 
Shell :: cuda 10 install pytorch 
Shell :: install docker debian 
Shell :: uninstall vmware player 
Shell :: swithc branch in github 
Shell :: python alias 
Shell :: git keep empty folder 
Shell :: ubuntu absolute path of file 
Shell :: Delete all linux package 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =