4 ms·
I try to use line breaks instead, it only took a little getting used to for i in $(seq 100) do if expr $i % 5 > /dev/null then if expr $i % 3 > /dev/n
by erik_seaberg 4y ago
I try to use line breaks instead, it only took a little getting used to
for i in $(seq 100)
do if expr $i % 5 > /dev/null
then if expr $i % 3 > /dev/null
then echo $i
else echo fizz
fi
else if expr $i % 3 > /dev/null
then echo buzz
else echo fizzbuzz
fi
fi
done
- usr1106 4y agoI did that at university around 30 years ago. I think nowadays 1TBS is much more common.
- erik_seaberg 4y agoYeah, I use 1TBS and cuddled elses in Scala/Java/C++, but adding a semicolon to do it with a keyword feels like arguing with the grammar.