Skip to content

Instantly share code, notes, and snippets.

@tateisu tateisu/gist:2814924
Created May 27, 2012

Embed
What would you like to do?
bash function returns array
#!/bin/bash
abc=(a b c)
for (( I=0; I < ${#abc[*]}; ++I ))
do
echo $I ${abc[$I]}
done
function func1(){
echo "d e f"
}
def=(`func1`)
for (( I=0; I < ${#def[*]}; ++I ))
do
echo $I ${def[$I]}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.