var_subst_in_for.tests 814 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. if test $# = 0; then
  2. exec "$THIS_SH" var_subst_in_for.tests abc "d e"
  3. fi
  4. echo 'Testing: in x y z'
  5. for a in x y z; do echo ".$a."; done
  6. echo 'Testing: in u $empty v'
  7. empty=''
  8. for a in u $empty v; do echo ".$a."; done
  9. echo 'Testing: in u " $empty" v'
  10. empty=''
  11. for a in u " $empty" v; do echo ".$a."; done
  12. echo 'Testing: in u $empty $empty$a v'
  13. a='a'
  14. for a in u $empty $empty$a v; do echo ".$a."; done
  15. echo 'Testing: in $a_b'
  16. a_b='a b'
  17. for a in $a_b; do echo ".$a."; done
  18. echo 'Testing: in $*'
  19. for a in $*; do echo ".$a."; done
  20. echo 'Testing: in $@'
  21. for a in $@; do echo ".$a."; done
  22. echo 'Testing: in -$*-'
  23. for a in -$*-; do echo ".$a."; done
  24. echo 'Testing: in -$@-'
  25. for a in -$@-; do echo ".$a."; done
  26. echo 'Testing: in $a_b -$a_b-'
  27. a_b='a b'
  28. for a in $a_b -$a_b-; do echo ".$a."; done
  29. echo Finished