| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | |
| 3 | # If $IFS set, but empty, |
| 4 | #+ then "$*" and "$@" do not echo positional params as expected. |
| 5 | |
| 6 | mechoscip-shell shell abs-guide 10-4 mecho(). () # Echo positional parameters. |
| 7 | { |
| 8 | echoscip-shell system . . echo. "$1,$2,$3"; |
| 9 | } |
| 10 | |
| 11 | |
| 12 | IFS="" # Set, but empty. |
| 13 | set a b c # Positional parameters. |
| 14 | |
| 15 | mechoscip-shell shell abs-guide 10-4 mecho(). "$*" # abc,, |
| 16 | # ^^ |
| 17 | mechoscip-shell shell abs-guide 10-4 mecho(). $* # a,b,c |
| 18 | |
| 19 | mechoscip-shell shell abs-guide 10-4 mecho(). $@ # a,b,c |
| 20 | mechoscip-shell shell abs-guide 10-4 mecho(). "$@" # a,b,c |
| 21 | |
| 22 | # The behavior of $* and $@ when $IFS is empty depends |
| 23 | #+ on which Bash or sh version being run. |
| 24 | # It is therefore inadvisable to depend on this "feature" in a script. |
| 25 | |
| 26 | |
| 27 | # Thanks, Stephane Chazelas. |
| 28 | |
| 29 | exit |