1 # This program is free software: you can redistribute it and/or modify
2 # it under the terms of the GNU General Public License as published by
3 # the Free Software Foundation, either version 3 of the License, or
4 # (at your option) any later version.
6 # This program is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 # GNU General Public License for more details.
11 # You should have received a copy of the GNU General Public License
12 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15 # a nonsense script and shell function to test out the command printing code
19 # simple command with redir
20 echo this is ${0##*/} > /dev/null
23 echo a | cat - > /dev/null
25 test -f ${0##*/} && echo ${0##*/} is a regular file
26 test -d ${0##*/} || echo ${0##*/} is not a directory
28 echo a ; echo b ; echo c
30 echo background >/dev/null &
43 [[ -r /dev/fd/0 && -w /dev/fd/1 ]] || echo oops > /dev/null
45 for name in $( echo 1 2 3 ); do
49 if [[ -r /dev/fd/0 && -w /dev/fd/1 ]] ; then
51 elif (( 7 > 40 )) ; then
58 *$PWD*) echo \$PWD in \$PATH ;;
59 *) echo \$PWD not in \$PATH ;;
62 while false; do echo z; done > /dev/null
64 until true; do echo z ; done > /dev/null
66 echo \&\|'()' \{ echo abcde \; \}
67 # when not in POSIX mode, we can have weirdly-named functions
68 eval fu\%nc'()' \{ echo abcde \; \}
74 ( { time -p echo a | cat - > /dev/null ; } ) 2>&1