Monday, March 13, 2017

Bash Scripting: redirecting file input

#!/bin/bash
#
# redirecting file input
#
exec 0<~/sandbox/scripts/data.d/states1
count=1
while read line
do
        echo "Line #$count: $line"
        count=$[ $count + 1 ]
done
echo "File processed"

No comments:

Post a Comment