[BACK]Return to test04 CVS log [TXT][DIR] Up to [cvs] / v6shell / tests

File: [cvs] / v6shell / tests / test04 (download)

Revision 1.4, Sat Dec 15 21:01:08 2018 UTC (2 months, 1 week ago) by jneitzel
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +2 -2 lines

Update tests/* (- tests/*.log); 'io' to 'nl' changes...; that's all

: etsh/tsh - " Force sh(1), csh(1), and other shells to exit w/ error! " <'' ;;;
:
: "  The author of this file, J.A. Neitzel <jan (at) etsh (dot) nl>,  "
: "  hereby grants it to the public domain.                           "
:
: "  From:  https://etsh.nl/tests  "
:

:
: test04 - syntactically correct
:

echo Begin ...

: The following is perfectly legal in etsh and tsh ...

	;;;;;;
	 ; ; ; ; ; ; 
	&&&&&&
	 & & & & & & 

: Quotes ...

	echo "\"
	echo '\'
	echo \\
	echo "Hello World! =)"
	echo 'Hello World! =)'
	echo Hello\ World!\ =\)

: Redirections ...

	cat <input >/dev/null
	<input cat >/dev/null
	<input >/dev/null cat
	cat < input > /dev/null
	< input cat > /dev/null
	< input > /dev/null cat

	cat <input >>/dev/null
	<input cat >>/dev/null
	<input >>/dev/null cat
	cat < input >> /dev/null
	< input cat >> /dev/null
	< input >> /dev/null cat

	cat >/dev/null <input
	>/dev/null cat <input
	>/dev/null <input cat
	cat > /dev/null < input
	> /dev/null cat < input
	> /dev/null < input cat

	cat >>/dev/null <input
	>>/dev/null cat <input
	>>/dev/null <input cat
	cat >> /dev/null < input
	>> /dev/null cat < input
	>> /dev/null < input cat

	( cat ) <input >/dev/null
	<input ( cat ) >/dev/null
	<input >/dev/null ( cat )
	( cat ) < input > /dev/null
	< input ( cat ) > /dev/null
	< input > /dev/null ( cat )

	( cat ) <input >>/dev/null
	<input ( cat ) >>/dev/null
	<input >>/dev/null ( cat )
	( cat ) < input >> /dev/null
	< input ( cat ) >> /dev/null
	< input >> /dev/null ( cat )

	(cat) <input >/dev/null
	<input (cat) >/dev/null
	<input >/dev/null (cat)
	(cat) < input > /dev/null
	< input (cat) > /dev/null
	< input > /dev/null (cat)

	(cat) <input >>/dev/null
	<input (cat) >>/dev/null
	<input >>/dev/null (cat)
	(cat) < input >> /dev/null
	< input (cat) >> /dev/null
	< input >> /dev/null (cat)

	( cat ) >/dev/null <input
	>/dev/null ( cat ) <input
	>/dev/null <input ( cat )
	( cat ) > /dev/null < input
	> /dev/null ( cat ) < input
	> /dev/null < input ( cat )

	( cat ) >>/dev/null <input
	>>/dev/null ( cat ) <input
	>>/dev/null <input ( cat )
	( cat ) >> /dev/null < input
	>> /dev/null ( cat ) < input
	>> /dev/null < input ( cat )

	(cat) >/dev/null <input
	>/dev/null (cat) <input
	>/dev/null <input (cat)
	(cat) > /dev/null < input
	> /dev/null (cat) < input
	> /dev/null < input (cat)

	(cat) >>/dev/null <input
	>>/dev/null (cat) <input
	>>/dev/null <input (cat)
	(cat) >> /dev/null < input
	>> /dev/null (cat) < input
	>> /dev/null < input (cat)

: Pipes ...

	echo Hello 01! | cat | grep '^H'
	echo Hello 02! ^ cat ^ grep '^H'
	echo Hello 03! | : nothing | grep '^H'
	echo Hello 04! ^ : nothing ^ grep '^H'
	echo Hello 05! | cat | : nothing | cat | grep '^H'
	echo Hello 06! ^ cat ^ : nothing ^ cat ^ grep '^H'
	echo Hello 07!|cat|grep '^H'
	echo Hello 08!^cat^grep '^H'
	echo Hello 09!|: nothing|grep '^H'
	echo Hello 10!^: nothing^grep '^H'
	echo Hello 11!|cat|: nothing|cat|grep '^H'
	echo Hello 12!^cat^: nothing^cat^grep '^H'

: Subshells ...

	( echo Hello 13! ) | ( cat ) | ( grep '^H' )
	( ( echo Hello 14! ) | ( cat ) | ( grep '^H' ) )
	( echo Hello 15! ) ^ ( cat ) ^ ( grep '^H' )
	( ( echo Hello 16! ) ^ ( cat ) ^ ( grep '^H' ) )
	echo Hello 17! | ( ( cat ) | grep '^H' )
	( echo Hello 18! | ( ( cat ) | grep '^H' ) )
	echo Hello 19! ^ ( ( cat ) ^ grep '^H' )
	( echo Hello 20! ^ ( ( cat ) ^ grep '^H' ) )
	( echo Hello 21! | ( cat ) ) | grep '^H'
	( ( echo Hello 22! | ( cat ) ) | grep '^H' )
	( echo Hello 23! ^ ( cat ) ) ^ grep '^H'
	( ( echo Hello 24! ^ ( cat ) ) ^ grep '^H' )
	( echo Hello 25! ) | ( cat >/dev/null ) | ( grep '^H' )
	( ( echo Hello 26! ) | ( cat >/dev/null ) | ( grep '^H' ) )
	( echo Hello 27! ) ^ ( cat >/dev/null ) ^ ( grep '^H' )
	( ( echo Hello 28! ) ^ ( cat >/dev/null ) ^ ( grep '^H' ) )
	( echo Hello 29! ) | ( : nothing ) | ( grep '^H' )
	( ( echo Hello 30! ) | ( : nothing ) | ( grep '^H' ) )
	( echo Hello 31! ) ^ ( : nothing ) ^ ( grep '^H' )
	( ( echo Hello 32! ) ^ ( : nothing ) ^ ( grep '^H' ) )
	( echo one ) ; ( echo two ) ; ( echo three )
	( ( echo one ) ; ( echo two ) ; ( echo three ) )
	( echo \( one \) ) ; ( echo \( two \) ) ; ( echo \( three \) )
	( ( echo \( one \) ) ; ( echo \( two \) ) ; ( echo \( three \) ) )

	(echo Hello 33!)|(cat)|(grep '^H')
	((echo Hello 34!)|(cat)|(grep '^H'))
	(echo Hello 35!)^(cat)^(grep '^H')
	((echo Hello 36!)^(cat)^(grep '^H'))
	echo Hello 37!|((cat)|grep '^H')
	(echo Hello 38!|((cat)|grep '^H'))
	echo Hello 39!^((cat)^grep '^H')
	(echo Hello 40!^((cat)^grep '^H'))
	(echo Hello 41!|(cat))|grep '^H'
	((echo Hello 42!|(cat))|grep '^H')
	(echo Hello 43!^(cat))^grep '^H'
	((echo Hello 44!^(cat))^grep '^H')
	(echo Hello 45!)|(cat >/dev/null)|(grep '^H')
	((echo Hello 46!)|(cat >/dev/null)|(grep '^H'))
	(echo Hello 47!)^(cat >/dev/null)^(grep '^H')
	((echo Hello 48!)^(cat >/dev/null)^(grep '^H'))
	(echo Hello 49!)|(: nothing)|(grep '^H')
	((echo Hello 50!)|(: nothing)|(grep '^H'))
	(echo Hello 51!)^(: nothing)^(grep '^H')
	((echo Hello 52!)^(: nothing)^(grep '^H'))
	(echo one);(echo two);(echo three)
	((echo one);(echo two);(echo three))
	(echo \(one\));(echo \(two\));(echo \(three\))
	((echo \(one\));(echo \(two\));(echo \(three\)))

	( ( echo Hello 53! ) | \
	  ( cat | ( cat | cat | cat ) | cat ) | \
	  ( grep '^H' ) )
	( ( echo Hello 54! ) ^ \
	  ( cat ^ ( cat ^ cat ^ cat ) ^ cat ) ^ \
	  ( grep '^H' ) )
	( ( echo Hello 55! ) | \
	  ( cat | ( cat | : nothing | cat ) | cat ) | \
	  ( grep '^H' ) )
	( ( echo Hello 56! ) ^ \
	  ( cat ^ ( cat ^ : nothing ^ cat ) ^ cat ) ^ \
	  ( grep '^H' ) )

	((echo Hello 57!)|(cat|(cat|cat|cat)|cat)|(grep '^H'))
	((echo Hello 58!)^(cat^(cat^cat^cat)^cat)^(grep '^H'))
	((echo Hello 59!)|(cat|(cat|: nothing|cat)|cat)|(grep '^H'))
	((echo Hello 60!)^(cat^(cat^: nothing^cat)^cat)^(grep '^H'))

: Asynchronous ...

	( sleep 3 ; echo 'sleep 3 : done' ) & \
	( sleep 4 ; echo 'sleep 4 : done' ) & \
	( sleep 5 ; echo 'sleep 5 : done' ) & \
	wait

echo End .