Menu

#100 Not All Commands in an Alias Expansion Execute

bash 4.4.0(0)
closed-fixed
5
2017-09-25
2016-03-01
No

When using Bash 4.3.42(1) or earlier on OpenVMS, when alias expansion is in effect and the alias expands to a string with new line separated commands, only the commands up to and including the first script file or subshell command are executed; all remaining commands do not execute. For example in the following script only the first command from the second alias expansion is execcuted:

THIS=alias2
FN=$THIS.script

cat > $FN <<'EOF'
#
(echo "$1")
EOF
chmod u+x $FN

shopt -s expand_aliases

alias foo1='$FN one; source $FN two; source $FN three; $FN four'

alias foo2='$FN one
source $FN two
source $FN three
$FN four'

foo1
foo2

rm -f $FN

Discussion

  • Eric Robertson

    Eric Robertson - 2016-03-01
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,4 @@
    -When using Bash 4.3.42(1) or earlier on OpenVMS, when alias expansion is in effect and the alias expands to a string with new line separated commands, only the commands up to and including the first disk command or subshell command are executed; all remaining commands do not execute. For example in the following script only the first command from the second alias expansion is execcuted:
    +When using Bash 4.3.42(1) or earlier on OpenVMS, when alias expansion is in effect and the alias expands to a string with new line separated commands, only the commands up to and including the first script file  or subshell command are executed; all remaining commands do not execute. For example in the following script only the first command from the second alias expansion is execcuted:
    
     THIS=alias2
     FN=$THIS.script
    
     
  • Eric Robertson

    Eric Robertson - 2017-09-25
    • status: open --> closed-fixed
     
MongoDB Logo MongoDB