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.

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter8: Advanced Data Handling Concepts
Section: Chapter Questions
Problem 18RQ
icon
Related questions
Question
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.
Transcribed Image Text: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.
AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning