Skip to content

Instantly share code, notes, and snippets.

@fmbenhassine
Created April 28, 2013 17:00
Show Gist options
  • Save fmbenhassine/7ecde51f1a8e843672fe to your computer and use it in GitHub Desktop.
Save fmbenhassine/7ecde51f1a8e843672fe to your computer and use it in GitHub Desktop.
Read a file line by line using bash
#!/bin/bash
myFile=/data/in/input.csv
while read line
do
echo "$line"
done < $myFile
dir=`ls /data/in`
for myFile in $dir
do
echo wc -l "$myFile"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment