UNIX/Linux Programming Answers

Questions: 33

Free Answers by our Experts: 25

Ask Your question

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!

Search & Filtering

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
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
Write a program to implement Peterson’s solution for Critical
Section problem.
WAP to read last 5 characters from a file using system calls.
Write a program to simulate deadlock in the system which involves
3 threads and 3 resources.
Write a program to create a thread that calculates the average
marks of a student.The result is passed back to the main process
for printing.(c or c++)
write a script which keeps track of the first and last user who used the system every wednesday. the entries should be saved in a file named “wed.txt” under two columns “user_name” and “time_in”. when the total number of entries in this file reach 50 find out the user withthe maximum number of entries.
How might you use the “find” command to produce a long listing of every “.zip” file in the current directory and all of its subdirectories?
What single flag to “cat”is equivalent to the flags “-v”, “-E” and “-T” all together, and what does this single flag do?
What single flag to “cat”is equivalent to the flags “-v”, “-E” and “-T” all together, and what does this single flag do?
LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS