Answer to Question #122619 in UNIX/Linux Programming for Astrid Garcia

Question #122619
Create a shell script which prints the line contents when the line number is divisible by 3 from an input file. Assume the first line is line 1. At the end of the script, if the total number of lines divisible by 3 is greater than 10, print “big”. Otherwise, print “small”.

I need help in answering this question. so far this is what I have

echo $1

file=$1

awk 'NR%2==0' $file

count=$(wc -l $file | grep -o "^[0-9]")

if [ $count -gt 20 ]
then
printf "\nbig\n"
else
printf "\nsmall\n"
fi
1
Expert's answer
2020-06-16T06:37:33-0400
Dear Astrid Garcia, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS