Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- variable reset in a bash script
- #!/bin/bash
- N=0
- ls -l | while read L; do
- N=$((N+1))
- echo $N
- done
- echo "total $N"
- 1
- 2
- 3
- total 0
- #!/bin/bash
- IFS=
- N=0
- while read L; do
- N=$((N+1))
- echo $N
- done <<<$(ls -l)
- echo "total $N"
Add Comment
Please, Sign In to add comment