Skip to content

Instantly share code, notes, and snippets.

@adoyle-h adoyle-h/1.bash
Last active Jul 6, 2019

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.