Skip to content

Instantly share code, notes, and snippets.

@adoyle-h
Last active July 6, 2019 14:32
Show Gist options
  • Save adoyle-h/ff0a94256489de643c6dade391c969ba to your computer and use it in GitHub Desktop.
Save adoyle-h/ff0a94256489de643c6dade391c969ba to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
shopt -s inherit_errexit
declare -a k
echo "IFS=$IFS"
IFS=',' k=( $(printf '1,2,3') )
echo ${#k[@]}
echo "IFS=$IFS"
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
shopt -s inherit_errexit
declare -a k
echo "IFS=$IFS"
foo() {
k=( $(printf '1,2,3') )
}
IFS=',' foo
echo ${#k[@]}
echo "IFS=$IFS"
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
shopt -s inherit_errexit
echo "IFS=$IFS"
IFS=',' echo '1,2,3'
echo "IFS=$IFS"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment