The shell scripting exercises sheet 1 Provide screen shots for all output its necessary 1. Write a script Prog1 callable with one argument (the name of a directory) and displays as output the contents of that directory. 2. Write a script Sum callable with two arguments (integers) and displays their sum on the screen 3. write a script Prog2 callable with a parameter and displays on the screen if it is a file, directory or neither file nor directory 4. Write script Prog3 to concatenate two files f1 and f2 into a file f3 and display the number of words of f3 (f1 and f2 must be created beforehand). 5. Write a script Prog4 which: • Create a directory Rep . © Create in that directory the file liste1 containing a detailed list of files and directories existing in the current directory. • Make a copy of the file list1 under the name list2 in Rep • Remove the file List1. 6. Write a script Prog5 which: Read a value from user and create a pattern as mentioned above Sample Execution / Output: # sh prog5 Give the value of n 3 The pattern is: 1 1 2 123 7. User must provide two numbers and operator through command-line output. Sampie Execution #sh calculator 25+ 41 67 #sh calculator 10 * 5 50 System Administration/ Spring 2023 / CIT / Page |
The shell scripting exercises sheet 1 Provide screen shots for all output its necessary 1. Write a script Prog1 callable with one argument (the name of a directory) and displays as output the contents of that directory. 2. Write a script Sum callable with two arguments (integers) and displays their sum on the screen 3. write a script Prog2 callable with a parameter and displays on the screen if it is a file, directory or neither file nor directory 4. Write script Prog3 to concatenate two files f1 and f2 into a file f3 and display the number of words of f3 (f1 and f2 must be created beforehand). 5. Write a script Prog4 which: • Create a directory Rep . © Create in that directory the file liste1 containing a detailed list of files and directories existing in the current directory. • Make a copy of the file list1 under the name list2 in Rep • Remove the file List1. 6. Write a script Prog5 which: Read a value from user and create a pattern as mentioned above Sample Execution / Output: # sh prog5 Give the value of n 3 The pattern is: 1 1 2 123 7. User must provide two numbers and operator through command-line output. Sampie Execution #sh calculator 25+ 41 67 #sh calculator 10 * 5 50 System Administration/ Spring 2023 / CIT / Page |
Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter7: File Handling And Applications
Section: Chapter Questions
Problem 20RQ
Related questions
Question
Help me please
![The shell scripting exercises sheet 1
Provide screen shots for all output its necessary
1. Write a script Prog1 callable with one argument (the name of a directory) and displays
as output the contents of that directory.
2. Write a script Sum callable with two arguments (integers) and displays their sum on
the screen
3. write a script Prog2 callable with a parameter and displays on the screen if it is a file,
directory or neither file nor directory
4. Write script Prog3 to concatenate two files f1 and f2 into a file f3 and display the
number of words of f3 (f1 and f2 must be created beforehand).
5. Write a script Prog4 which:
• Create a directory Rep
.
© Create in that directory the file liste1 containing a detailed list of files and
directories existing in the current directory.
• Make a copy of the file list1 under the name list2 in Rep
• Remove the file List1.
6. Write a script Prog5 which: Read a value from user and create a pattern as
mentioned above
Sample Execution / Output:
# sh prog5
Give the value of n
3
The pattern is:
1
1 2
123
7. User must provide two numbers and operator through command-line
output.
Sampie Execution
#sh calculator 25+ 41
67
#sh calculator 10 * 5
50
System Administration/ Spring 2023 / CIT / Page |](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F9de96c8b-38d4-43ae-ac2a-08d3ed4f8d0c%2Feabf8167-57be-4243-9c2f-b5c8de2f679b%2Fhtfrc_processed.jpeg&w=3840&q=75)
Transcribed Image Text:The shell scripting exercises sheet 1
Provide screen shots for all output its necessary
1. Write a script Prog1 callable with one argument (the name of a directory) and displays
as output the contents of that directory.
2. Write a script Sum callable with two arguments (integers) and displays their sum on
the screen
3. write a script Prog2 callable with a parameter and displays on the screen if it is a file,
directory or neither file nor directory
4. Write script Prog3 to concatenate two files f1 and f2 into a file f3 and display the
number of words of f3 (f1 and f2 must be created beforehand).
5. Write a script Prog4 which:
• Create a directory Rep
.
© Create in that directory the file liste1 containing a detailed list of files and
directories existing in the current directory.
• Make a copy of the file list1 under the name list2 in Rep
• Remove the file List1.
6. Write a script Prog5 which: Read a value from user and create a pattern as
mentioned above
Sample Execution / Output:
# sh prog5
Give the value of n
3
The pattern is:
1
1 2
123
7. User must provide two numbers and operator through command-line
output.
Sampie Execution
#sh calculator 25+ 41
67
#sh calculator 10 * 5
50
System Administration/ Spring 2023 / CIT / Page |
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781305480537/9781305480537_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
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](https://www.bartleby.com/isbn_cover_images/9781305480537/9781305480537_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
![LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.](https://www.bartleby.com/isbn_cover_images/9781337569798/9781337569798_smallCoverImage.gif)
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:
9781337569798
Author:
ECKERT
Publisher:
CENGAGE L
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning