Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LINES=$(wc -l < testfile)
- COUNTER=0
- export COUNTER
- filename="$1"
- echo "length is $LINES"
- while read -r line; do
- name="$line"
- echo "done smth with line $name"
- export COUNTER=$(($COUNTER+1))
- echo $COUNTER/$LINES
- done < "$filename"
- echo $COUNTER
- #length is 3
- #done smth with line first
- #1/ 3
- #done smth with line second
- #2/ 3
- #done smth with line third
- #3/ 3
- #3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement