Last active
December 10, 2015 17:08
-
-
Save ormaaj/4465894 to your computer and use it in GitHub Desktop.
IFS side-effects
This file contains hidden or 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
| #!/usr/bin/env bash | |
| for sh in ~/doc/programs/bash43 {{b,d}a,po,{m,}k,z}sh bb; do | |
| printf '%-8s' "${sh##*/}:" | |
| "$sh" </dev/fd/0 | |
| done <<\EOF | |
| ${ZSH_VERSION+:} false && emulate sh | |
| set -f -- a b c | |
| unset -v IFS | |
| printf '<%s> ' ${*}${IFS=}${*}${IFS:=-}"${*}" | |
| echo | |
| EOF | |
| # vim: set fenc=utf-8 ff=unix ft=sh : |
This file contains hidden or 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
| 8/11/13 -- current versions: | |
| bash43: <a> <b> <ca> <b> <c-a-b-c> | |
| bash: <a> <b> <ca> <b> <c-a b c> | |
| dash: <a b cabc> <a-b-c> | |
| posh: <a> <b> <ca b c> <a-b-c> | |
| mksh: <a> <b> <ca> <b> <c> <a-b-c> | |
| ksh: <a> <b> <ca> <b> <c> <a b c> | |
| zsh: <a> <b> <ca> <b> <c> <a-b-c> | |
| bb: <a b cabc> <a-b-c> | |
| --- | |
| old: | |
| bash: <a> <b> <ca> <b> <c-a b c> | |
| dash: <a b cabc> <a-b-c> | |
| posh: <a> <b> <ca b c> <a-b-c> | |
| mksh: <a> <b> <ca b c> <a-b-c> | |
| ksh : <a> <b> <ca> <b> <c> <a b c> | |
| zsh : <a> <b> <ca> <b> <c> <a-b-c> | |
| bb : <a b cabc> <a-b-c> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment