Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 2. The default rm command will not confirm before it deletes any regular files. Write a short script called safe_rm, such that it will

Exercise 2. The default rm command will not confirm before it deletes any regular files. Write a short script called safe_rm, such that it will make a copy before deleting a single file (that is, we do not use wildcard expressions for this problem) by doing the following: Take one and only one argument at the command line (hint: search for an expression rep- resenting the number of arguments in the shell scripts). Print out an error message if no argument or more than one arguments are provided (hint: use echo). Create a directory safe_rm_recycle" in the current one if it is not already created. Copy the file indicated by the first argument to this safe_rm_recycle" folder. Remove this file in the current working directory.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions