2 # a nonsense script and shell function to test out the command printing code
6 # simple command with redir
7 echo this is ${0##*/} > /dev/null
10 echo a | cat - > /dev/null
12 test -f ${0##*/} && echo ${0##*/} is a regular file
13 test -d ${0##*/} || echo ${0##*/} is not a directory
15 echo a ; echo b ; echo c
17 echo background >/dev/null &
30 [[ -r /dev/fd/0 && -w /dev/fd/1 ]] || echo oops > /dev/null
32 for name in $( echo 1 2 3 ); do
36 if [[ -r /dev/fd/0 && -w /dev/fd/1 ]] ; then
38 elif (( 7 > 40 )) ; then
45 *$PWD*) echo \$PWD in \$PATH ;;
46 *) echo \$PWD not in \$PATH ;;
49 while false; do echo z; done > /dev/null
51 until true; do echo z ; done > /dev/null
53 echo \&\|'()' \{ echo abcde \; \}
54 # when not in POSIX mode, we can have weirdly-named functions
55 eval fu\%nc'()' \{ echo abcde \; \}
61 ( { time -p echo a | cat - > /dev/null ; } ) 2>&1