Skip to content

Instantly share code, notes, and snippets.

@knjname
Forked from tarot/ABashSubShellPitfall.sh
Created August 19, 2013 12:59
Show Gist options
  • Save knjname/6268850 to your computer and use it in GitHub Desktop.
Save knjname/6268850 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