medium10 pts · first answer countslinuxbash
Counter is zero after the loop
What does this Bash script print if errors.log has 5 lines?
count=0 cat errors.log | while read -r line; do count=$((count + 1)) done echo "$count"
Discussion 0
Join free to post in the discussion.
Related questions
- Reading logs of a systemd serviceSite Reliability Engineer
- Who is using port 8080?Site Reliability Engineer
- A process vanished overnightSite Reliability Engineer
- Safer Bash scriptsSite Reliability Engineer
- Hard link after deleting the originalSite Reliability Engineer
- The t at the end of /tmpSite Reliability Engineer
- Mode of a new file with umask 022Site Reliability Engineer
- Hiding error messages of a commandSite Reliability Engineer