Skip to content

Instantly share code, notes, and snippets.

@tarot
Forked from knjname/ABashSubShellPitfall.sh
Last active December 21, 2015 07:08
Show Gist options
  • Save tarot/6268812 to your computer and use it in GitHub Desktop.
Save tarot/6268812 to your computer and use it in GitHub Desktop.
#!/bin/bash
seq 0 10 | {
declare -i sum
while read num ; do
let sum+=$num
done
# bash => 55 (^^)v
# zsh => 55
echo $sum
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment