Created
May 27, 2012 16:11
-
-
Save tateisu/2814924 to your computer and use it in GitHub Desktop.
bash function returns array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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