Question

Write the following bourne shell scripts which perform the following actions.

1. Copy the file ~smcgowan/Cyber/Unix/Data/cards and write a bourne shell (/bin/sh) script that will grep it for the name "Mantle" (case INsensitive). If the grep finds any matches, output them to standard output. If there are no matches use echo to write a message to standard output that states that. (NOTE: The bourne shell does not assign a special meaning to the ~ character)

2. Write a bourne shell (/bin/sh) program that will test for the existence of a regular file. If it exists, output a line that states that. If it does not exist, echo a line that states that and touch the filename to create it. The program should accept the filename being tested as a positional parameter.

3. Copy the file called list from ~smcgowan/Cyber/Unix/Data. Write a bourne shell (/bin/sh) program that will accept a file name as a positional parameter and simply echo the values contained within that file to standard output in a single column.

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

#!/bin/sh
if grep -i "Mantle" /users/students/dhenr170/cards; then
echo...

This is only a preview of the solution. Please use the purchase button to see the entire solution

Assisting Tutor

Related Homework Solutions

System Calls in Linux
Homework Solution
$25.00
Computer Science
Linux
File Management
Lab Notes
System Calls
Buffer
Reads
Writes
Algorithms
Codes
Scripts
Input
Output
Errors
Arguments
Results
Computer Science Problems
Homework Solution
$30.00
Computer Science
Linux
C Programming Language
Kernel Source Tree
Systems
Numbers
Architecture
Integers
Input
Output
Strace Utility
Basic Commands
Algorithms
File Management
Compilers
Computer Science Questions
Homework Solution
$75.00
Computer Science
Linux
Memory
CPU
Algorithms
Jobs
Percentage
Deadlock
Programmers
PCS Scheduling
SCS Scheduling
Resources
Vectors
Tasks
System Snapshots
Logical Addresses
Physical Addresses
Transfers
Programming Questions
Homework Solution
$65.00
Programming
Computer Science
Parent Processes
Codes
C++
Linux
Fork
Child Processes
Code Segments
Ordinary Pipes
Strings
Messages
UNIX
Web Servers
Basic Mutex
Bank Accounts
Functions
SJF Algorithm
Get help from a qualified tutor
Live Chats