Hard
In the following script:
#bin/bash
counter=0
for file in ./*.txt
do
line=$(wc -l $file | cut -d" " -f1);
counter=$(($counter+$line))
done
echo "$counter"
What does the cut -d" " -f1
part do?
Author: titouan lecampStatus: PublishedQuestion passed 209 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!
1
How to set the permissions of a file in Bash?1
Find the default shell for a user in Bash1
Find all rows containing patterns 1 and 2 in a file using Bash2
Display lines containing 'Error' in all .txt files1
What does the shell prompt `user@user:~$` mean?1
Which line deletes all files in a directory? (visible and hidden files)1
Display lines 4 to 12 of a file in Bash