source7.sub 713 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. shopt -s expand_aliases
  2. : ${TMPDIR:=/var/tmp}
  3. echo '((echo abc; echo def;); echo ghi)' > $TMPDIR/x28-$$
  4. . $TMPDIR/x28-$$
  5. rm -f $TMPDIR/x28-$$
  6. echo after
  7. TMPFILE=$TMPDIR/x29-$$
  8. echo "#! ${THIS_SH}" >$TMPFILE
  9. cat >> $TMPFILE << \EOF
  10. (echo -n "$1 "; echo subshell)
  11. EOF
  12. chmod 755 $TMPFILE
  13. alias foo1='$TMPFILE one.1; source $TMPFILE two.1; source $TMPFILE three.1; $TMPFILE four.1'
  14. alias foo2='$TMPFILE one.2;
  15. source $TMPFILE two.2;
  16. source $TMPFILE three.2;
  17. $TMPFILE four.2;
  18. '
  19. foo1
  20. foo2
  21. echo x29 - done
  22. rm -f $TMPFILE
  23. # this is also treated similarly to an alias expansion internally
  24. ((echo abc; echo def;); echo ghi)
  25. if (((4+4) + (4 + 7))); then
  26. echo ok
  27. fi
  28. (()) # make sure the null expression works OK