-
-
Save d630/f7ab96ff1092d6fa3d3340db5eaff985 to your computer and use it in GitHub Desktop.
bash: Indentation styles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tab: 8 | |
# Bourne/Korn/Horstmann | |
while ((x == 1)) | |
do echo foo | |
echo bar | |
done | |
for ((i=0; i < 10; i++)) | |
do if ((i % 2 == 0)) | |
then echo foo "$i" | |
else echo fooElse "$i" | |
echo bar "$i" | |
fi | |
done | |
# Allman/"The UNIX Programming Environment" | |
while ((x == 1)) | |
do | |
echo foo | |
echo bar | |
done | |
for ((i=0; i < 10; i++)) | |
do | |
if ((i % 2 == 0)) | |
then | |
echo foo "$i" | |
else | |
echo fooElse "$i" | |
echo bar "$i" | |
fi | |
done | |
# GNU | |
while ((x == 1)) | |
do | |
echo foo | |
echo bar | |
done | |
for ((i=0; i < 10; i++)) | |
do | |
if ((i % 2 == 0)) | |
then | |
echo foo "$i" | |
else | |
echo fooElse "$i" | |
echo bar "$i" | |
fi | |
done | |
# Haskell | |
while ((x == 1)) | |
do echo foo | |
echo bar | |
done | |
for ((i=0; i < 10; i++)) | |
do if ((i % 2 == 0)) | |
then echo foo "$i" | |
else echo fooElse "$i" | |
echo bar "$i" | |
fi | |
done | |
# Whitesmith | |
while ((x == 1)) | |
do | |
echo foo | |
echo bar | |
done | |
for ((i=0; i < 10; i++)) | |
do | |
if ((i % 2 == 0)) | |
then | |
echo foo "$i" | |
else | |
echo fooElse "$i" | |
echo bar "$i" | |
fi | |
done | |
# Pico | |
while ((x == 1)) | |
do echo foo | |
echo bar; done | |
for ((i=0; i < 10; i++)) | |
do if ((i % 2 == 0)) | |
then echo foo "$i" | |
else | |
echo fooElse "$i" | |
echo bar "$i"; fi; done | |
# C K&R style | |
while ((x == 1)); do | |
echo foo | |
echo bar | |
done | |
for ((i=0; i < 10; i++)); do | |
if ((i % 2 == 0)); then | |
echo foo "$i" | |
else | |
echo fooElse "$i" | |
echo bar "$i" | |
fi | |
done | |
# Ratliff | |
while ((x == 1)); do | |
echo foo | |
echo bar | |
done | |
for ((i=0; i < 10; i++)); do | |
if ((i % 2 == 0)); then | |
echo foo "$i" | |
else | |
echo fooElse "$i" | |
echo bar "$i" | |
fi | |
done | |
# Lisp | |
while ((x == 1)); do | |
echo foo | |
echo bar; done | |
for ((i=0; i < 10; i++)); do | |
if ((i % 2 == 0)); then | |
echo foo "$i" | |
else | |
echo fooElse "$i" | |
echo bar "$i"; fi; done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment