Created
March 19, 2013 08:10
-
-
Save Taeril/5194434 to your computer and use it in GitHub Desktop.
Play with eval to see where perlbrew broke
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/sh | |
export PATH=".:$PATH" | |
foobar_command='command foobar.sh' | |
#foobar_command='foobar.sh' | |
FOOBAR_FOO='foo-1.23.4' | |
# old | |
#eval "$(${foobar_command} env $FOOBAR_FOO)" | |
# new | |
#$(eval $foobar_command env $FOOBAR_FOO) | |
#set -x | |
#eval "$(eval "${foobar_command} env $FOOBAR_FOO")" | |
eval "$(eval ${foobar_command} env $FOOBAR_FOO)" | |
#set +x | |
env | grep 'FOOBAR' | |
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/sh | |
echo 'export FOOBAR_MANPATH="/home/user/perl5/perlbrew/perls/perl-5.16.3/man";' | |
echo 'export FOOBAR_PATH="/home/user/perl5/perlbrew/bin:/home/user/perl5/perlbrew/perls/perl-5.16.3/bin";' | |
echo "export FOOBAR_PERL=\"$2\";" | |
echo 'export FOOBAR_ROOT="/home/user/perl5/perlbrew";' | |
echo 'export FOOBAR_VERSION="0.60";' | |
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/sh | |
test_it() { | |
echo "--- $1" | |
$1 ./foo.sh | |
echo '---' | |
} | |
# GNU bash, version 4.2.37(1)-release (i486-pc-linux-gnu) | |
test_it '/bin/bash' | |
# zsh 4.3.17 (i686-pc-linux-gnu) | |
test_it '/usr/bin/zsh' | |
# from git | |
test_it '/tmp/foo/bin/zsh-5.0.2-dev-0' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment