Skip to content

Instantly share code, notes, and snippets.

@d630
Last active March 16, 2017 19:34
Show Gist options
  • Save d630/9d96d94f357c7f383ce00f154cc56ddc to your computer and use it in GitHub Desktop.
Save d630/9d96d94f357c7f383ce00f154cc56ddc to your computer and use it in GitHub Desktop.
shell: things you never see
#
for i
in {0..9}
do
echo "$i"
done
#
case "$p"
in
(foo) : ;;
(*) false
esac
#
: "${\
foo=bar\
}"
# https://github.com/oilshell/oil/issues/3
[[ ('(x=5, y[10]+=5), x*=y[10]' -eq x) && y[2]==y[10]?1:0 -eq 0 ]]
# http://lists.gnu.org/archive/html/help-bash/2017-03/msg00008.html
if(echo -n fo)then(echo o)fi
({(:)})
#
a=([arithmetic, 1+1]= [-1]=foo)
#
echo ${_[up, 1]}
@d630
Copy link
Author

d630 commented Nov 2, 2016

The case-clause in Algol68 was:

 case switch in statements, statements,... [ out statements ] esac
 "brief" form:  ( switch | statements,statements,... | statements )

So, the "out" is missing in sh

@d630
Copy link
Author

d630 commented Nov 2, 2016

for i in x was a new form in the history of for-loops

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment