Skip to content

Instantly share code, notes, and snippets.

@mattn
Created January 11, 2013 04:01
Show Gist options
  • Save mattn/4507864 to your computer and use it in GitHub Desktop.
Save mattn/4507864 to your computer and use it in GitHub Desktop.
#!/bin/bash
i=0
while read b; do
i=`expr $i + 1`
echo "$i $b"
done < <(ls)
echo "total $i"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment