Bash script, im still new to linux
How to append an existing file?
The existing file in the wastebasket will have the version number zero appended to it and the newly deleted file will have version number 1 appended to it. How the loop looks like? My script be like Quote:
actually this is the question given Instructions The goal of this assignment is to write a shell script to replace the rm command and provide undelete capability similar to MS-DOS. Write a shell program to duplicate the Linux rm command with the following features: Your new rm command is delete 1. It will have a switch -i that will act in the same manner as in the rm command. 2. Instead of deleting the files, it will move them to a mywastebasket directory. If the file already exists in the mywastebasket directory, then the existing file (in the mywastebasket) will have the version number zero appended to it and the newly deleted file will have version number one appended to it. If the version number setup is already in use for that file then the newest one will simply have the next version number in the series appended to it. It's your choice as to what system to use for this. Just be sure that it is a unique system and will not be part of any normal file naming convention you might use. ----------- For step 2 The loop for append Mybe i should use Quote:
-------------- 3. It will have a switch -c that will clear the entire mywastebasket after asking for confirmation. The -i and -c switches may be combined to ask for confirmation on individual files. ----------------- for the step 3 i should using alias right for substitute -c, ----------------- Don't forget that wildcards and multiple files are allowed on the command line. The switches when combined may be in any order but must be before any filenames. Your program must also catch any operator errors. I'm still learning by myself and has poor understanding of linux things. |
Bash script, im still new to linux
Please make your code more readable with code tags (see my signature).
Quote:
Quote:
In the remaining text, I don't know what is code, what is pseudocode, what is command output and what are your comments, In other words, I don't understand what you mean. Can you provide an example? |
Just curious, where is the top post you're answering to?
|
Im post it, then edit, but after that it suddenly missing
|
Quote:
|
Quote:
|
OP has created a new thread https://www.linuxquestions.org/quest...on-4175678054/.
Perhaps best to delete this one. I will report it. |
All times are GMT -5. The time now is 06:36 PM. |