document updated 12 years ago, on Jul 2, 2012
If you infrequently program in a language, it can be helpful to quickly glance at examples of code to help remember the syntax specifics. This page lists such examples.
In particular, this page focuses on control structures and OO syntax.
Bash
- tkj.freeshell.org
- cyberciti.biz
- wiki.bash-hackers.org
- most Linux distributions have a ton of Bash scripts for bootup, etc. To pick out some large ones:
ack -f --type=shell /etc /usr/bin /usr/sbin | xargs ls -lrS
find /etc /usr/sbin /usr/bin -type f | perl -nle 'next unless -x && -T; open my$a, $_; print if <$a> =~ m[^#!.*/(bash|sh)$]' | xargs ls -lrS | tail -100
- configure scripts have somewhat complex Bash code
locate -br ^configure\$ | xargs -r ls -lrS