1. Modify cofile such that it will keep a copy of the old existing file (if available) before the renaming operating. As
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
1. Modify cofile such that it will keep a copy of the old existing file (if available) before the renaming operating. As
1. Modify cofile such that it will keep a copy of the old existing file (if available) before the renaming operating. Assume that apple.txt will be renamed as orange.txt. When the command "/cofile apple.txt orange.txt" is executed, the script will first check whether orange.txt exists under the given path or not. If the file exists then orange.ext will be renamed as orange.txtold before renaming apple.txt as orange.txt. Make tofile an executable shell script; try to rename a file to a filename that already exists. Show your shell program and its output to the instructor.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!