Question

a: Analyse the following commands/programs and predict the output. i) awk ’$0 ~/aeiou/{print $0}’ file1 -(1...

a: Analyse the following commands/programs and predict the output. i) awk ’$0 ~/aeiou/{print $0}’ file1 -(1 mark) ii) tail << file1.txt >> file2.txt -(1 mark) iii) echo "enter directory name" -(2 marks) read dir if [ -d $dir ] then ls $dir else echo "enter proper directory name" fi

0 0
Add a comment Improve this question Transcribed image text
Answer #1

i) It prints the contents of  file that contains "aeiou" i.e it must contain aeiou as a part $0 is of no significance ,If there is $1 then it prints first field of files that contains aeiou

ii)There is no ouput for this command

iii) It asks user to enter directory from user if directory exists then it prints the files that are in present in that directory,if directory does not exists it prints message "enter proper directory name"

Add a comment
Know the answer?
Add Answer to:
a: Analyse the following commands/programs and predict the output. i) awk ’$0 ~/aeiou/{print $0}’ file1 -(1...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT