all tasks

This commit is contained in:
Ingy döt Net 2013-04-11 01:07:29 -07:00
parent b83f433714
commit 68f8f3e56b
14735 changed files with 178959 additions and 0 deletions

View file

@ -0,0 +1,19 @@
a() {
echo "Called a $1"
"$1"
}
b() {
echo "Called b $1"
"$1"
}
for i in false true; do
for j in false true; do
a $i && b $j && x=true || x=false
echo " $i && $j is $x"
a $i || b $j && y=true || y=false
echo " $i || $j is $y"
done
done

View file

@ -0,0 +1,12 @@
alias a eval \''echo "Called a \!:1"; "\!:1"'\'
alias b eval \''echo "Called b \!:1"; "\!:1"'\'
foreach i (false true)
foreach j (false true)
a $i && b $j && set x=true || set x=false
echo " $i && $j is $x"
a $i || b $j && set x=true || set x=false
echo " $i || $j is $x"
end
end

View file

@ -0,0 +1,8 @@
# Succeeds, only prints "ok".
if ( 1 || { echo This command never runs. } ) echo ok
# Fails, aborts shell with "bad: Undefined variable".
if ( 1 || $bad ) echo ok
# Prints "error", then "ok".
if ( 1 || `echo error >/dev/stderr` ) echo ok