Medium
What does the following script do?
#bin/bash
counter=0
for file in ./*.txt
do
line=$(wc -l $file | cut -d" " -f1);
counter=$(($counter+$line))
done
echo "$counter"
Author: W3D TeamStatus: PublishedQuestion passed 306 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!
2
How to set the permissions of a file in Bash?2
Display lines containing 'Error' in all .txt files1
What does 2>&1 means in the script below?
```
compile "$i" > "${i%.txt}".ass 2>&1
```1
Find all rows containing patterns 1 and 2 in a file using Bash1
What does the shell prompt `user@user:~$` mean?1
Write a bash script that prints the numbers from 1 to 11.2
Find the default shell for a user in Bash