Pages

Saturday, September 27, 2014

bash: not a bug, a feature .... (?)

$ export Q='() { a=$(pwd); [ -z "$Q_env" ] && export Q_env=$*; b=$Q_env; echo "a=$a, b=$b,"; }; Q $(pwd)'; bash -c "Q; cd ~/Desktop; Q"

It looks like this "feature" let us to "eval" and "bind" a lexical env at subshell start.


For sure, it could have some 'legal' use ...




commandlinefu.com


by David Winterbottom (codeinthehole.com)






from All commands http://ift.tt/1Bl90PY

No comments:

Post a Comment