by
0
7
4,107
8
Top 1% !
Popular
Famous
Tagged
Easy-to-find
Specified
OpenSource
Popularity: 2438th place
Created
Modified Oct 24, 2013
consolebash
LanguageBASH
LicenseMIT_X11
OSLinux

Bin bash array set and looping

This linux script sets a variable as array, then loops through all its items.
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/316/Bin-bash-array-set-and-looping?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
#!/bin/bash my_users_list=( elem1 elem2 elem3 ) for user in ${my_users_list[@]} do echo $user done
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus