Skip to content

Instantly share code, notes, and snippets.

@tanzyy
Last active April 11, 2017 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanzyy/50017e9514de4100ea995cc82b9028e8 to your computer and use it in GitHub Desktop.
Save tanzyy/50017e9514de4100ea995cc82b9028e8 to your computer and use it in GitHub Desktop.
Shell | Add value to array
#!/bin/bash
# This script shows how to declare array and and add vlaues to it.
result=()
result+=('foo')
result+=('bar')
for i in "${result[@]}"
do
echo $i
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment