i-bash/tests/cprint.right

73 lines
1.4 KiB
Text
Raw Normal View History

1999-02-19 17:11:39 +00:00
tf is a function
tf ()
{
2006-10-10 14:15:34 +00:00
echo this is ${0##*/} > /dev/null;
echo a | cat - > /dev/null;
1999-02-19 17:11:39 +00:00
test -f ${0##*/} && echo ${0##*/} is a regular file;
test -d ${0##*/} || echo ${0##*/} is not a directory;
echo a;
echo b;
echo c;
2006-10-10 14:15:34 +00:00
echo background > /dev/null & ( exit 1 );
1999-02-19 17:11:39 +00:00
echo $?;
{
echo a
};
i=0;
2004-07-27 13:29:18 +00:00
while (( i < 3 )); do
1999-02-19 17:11:39 +00:00
test -r /dev/fd/$i;
i=$(( i + 1 ));
done;
2006-10-10 14:15:34 +00:00
[[ -r /dev/fd/0 && -w /dev/fd/1 ]] || echo oops > /dev/null;
1999-02-19 17:11:39 +00:00
for name in $( echo 1 2 3 );
do
test -r /dev/fd/$name;
done;
if [[ -r /dev/fd/0 && -w /dev/fd/1 ]]; then
2006-10-10 14:15:34 +00:00
echo ok > /dev/null;
1999-02-19 17:11:39 +00:00
else
2004-07-27 13:29:18 +00:00
if (( 7 > 40 )); then
1999-02-19 17:11:39 +00:00
echo oops;
else
echo done;
fi;
2006-10-10 14:15:34 +00:00
fi > /dev/null;
1999-02-19 17:11:39 +00:00
case $PATH in
*$PWD*)
echo \$PWD in \$PATH
;;
*)
echo \$PWD not in \$PATH
;;
2006-10-10 14:15:34 +00:00
esac > /dev/null;
1999-02-19 17:11:39 +00:00
while false; do
echo z;
2006-10-10 14:15:34 +00:00
done > /dev/null;
1999-02-19 17:11:39 +00:00
until true; do
echo z;
2006-10-10 14:15:34 +00:00
done > /dev/null;
1999-02-19 17:11:39 +00:00
echo \&\|'()' \{ echo abcde \; \};
eval fu\%nc'()' \{ echo abcde \; \};
type fu\%nc
}
tf2 is a function
tf2 ()
{
( {
2006-10-10 14:15:34 +00:00
time -p echo a | cat - > /dev/null
2001-04-06 19:14:31 +00:00
} ) 2>&1
}
1999-02-19 17:11:39 +00:00
cprint.tests is a regular file
cprint.tests is not a directory
a
b
c
1
a
&|() { echo abcde ; }
fu%nc is a function
fu%nc ()
{
echo abcde
}