Question: Any idea why I ' m outputting extra blank lines at line 2 and 4 . I've included my code down below # ! /

Any idea why I'm outputting extra blank lines at line 2 and 4. I've included my code down below
#!/bin/bash
echo "Dingo Truffle"
echo "Lab 3-Failed Login Report"
echo "CS 3030- Scripting Languages"
if ["$#"-ne 1]; then
echo "Usage: flog LOGFILE"
exit 1
fi
LOGFILE="$1"
# Search for failed password attemps of any kind using grep
grep 'Failed password for '"$LOGFILE" > s1out
# Extract the name of the user who failed to supply the proper pasword including invalid users
sed -n 's/.*Failed password for \([a-z0-9A-Z_]*\).*/\1/p' s1out > s2out
# Sort the user names
sort s2out > s3out
# Count the number of occurences of each username with uniq
uniq -c s3out > s4out
# Sort the output from uniq -c:
sort -k1,1nr -k2,2 s4out > s5out
# Change all instance of "invalid" to "" with HTML-friendly brackets
sed 's/invalid/\/' s6out
# Put commas in numbers
cat s6out| while read mycount myuserid; do
printf "%'d %s
""$mycount" "$myuserid" >> s7out
done
# add the html
printf "
Any idea why I ' m outputting extra blank lines

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!