Write a C shell (the first edition of the book mistakenly says Bash) script called mv (which replaces the GNU utility mv) that tries to rename the specified file (using the GNU utility mv), but if the destination file exists, instead creates an index number to append to the destination file, a sort of version number. (example omitted)

What will be an ideal response?

You will need to create a variable for this quasi-version number, increment it, create a new
filename with it, and test to see if the name exists. If it does, increment the counter and do it again.
When a name is found that doesn’t exist, use that name.

Computer Science & Information Technology

You might also like to view...

Compare and contrast the approaches to deadlock management in database systems.

What will be an ideal response?

Computer Science & Information Technology

(Member Object Destructors) Write a program illustrating that member object destructors are called for only those member objects that were constructed before an exception occurred.

What will be an ideal response?

Computer Science & Information Technology