System Administration Shell Scripts: exercises sheet 2 Exercise 1: Write a shell script that displays the contents of the directories existing in a directory given as argument (use the for loop) Exercice 2: Write a shell script that displays the contents of subdirectories of the directories that are given as arguments. The script should be called with any number of parameters. Exercice 3: Write a shell script that displays the nth line of a file(you can use head and tail). The integer n and the input file name are given by the user in response to the request of the script (use the command read). Try to do all possible tests (file exists or not etc...) Exercise 4: Write a shell script that give a variable x the following content "School man women fish dog cat sheep" and then print each word in a separate line on the screen (use the for loop). Exercise 5: Propose a shell script that displays the number of files in the present working directory.
System Administration Shell Scripts: exercises sheet 2 Exercise 1: Write a shell script that displays the contents of the directories existing in a directory given as argument (use the for loop) Exercice 2: Write a shell script that displays the contents of subdirectories of the directories that are given as arguments. The script should be called with any number of parameters. Exercice 3: Write a shell script that displays the nth line of a file(you can use head and tail). The integer n and the input file name are given by the user in response to the request of the script (use the command read). Try to do all possible tests (file exists or not etc...) Exercise 4: Write a shell script that give a variable x the following content "School man women fish dog cat sheep" and then print each word in a separate line on the screen (use the for loop). Exercise 5: Propose a shell script that displays the number of files in the present working directory.
Chapter14: Files And Streams
Section: Chapter Questions
Problem 2E: Create a program named FileComparison that compares two files. First, use a text editor such as...
Related questions
Question
plase jelp me
AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
Unlock instant AI solutions
Tap the button
to generate a solution
Recommended textbooks for you
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning