I have a Korn Shell script that works based on one input parameter. The user passes one string value to the script from the command line, like this:
script.ksh <string>
The script will list all files that match that string.
Then it will move files that contain that string into a directory for later archival. Example:
script.ksh *test*
will output this to the screen:
test.txt
test1.txt
job1.test
Then it will move those files to another directory.
MY QUESTION: HOW CAN I GET THE SCRIPT TO ASK THE USER IF THEY'RE SURE THEY WANT TO DO THIS, AFTER SEEING THE FILES THAT WILL BE MOVED? Currently, it just shows the list and moves the files. I need the user to verify the list is correct before moving on, or stop if the list is incorrect. I'd like the user to just have to type 'Y' or 'N'. Is there a way to do this in a Korn Shell Script? Any help would be awesome! Thanks!
script.ksh <string>
The script will list all files that match that string.
Then it will move files that contain that string into a directory for later archival. Example:
script.ksh *test*
will output this to the screen:
test.txt
test1.txt
job1.test
Then it will move those files to another directory.
MY QUESTION: HOW CAN I GET THE SCRIPT TO ASK THE USER IF THEY'RE SURE THEY WANT TO DO THIS, AFTER SEEING THE FILES THAT WILL BE MOVED? Currently, it just shows the list and moves the files. I need the user to verify the list is correct before moving on, or stop if the list is incorrect. I'd like the user to just have to type 'Y' or 'N'. Is there a way to do this in a Korn Shell Script? Any help would be awesome! Thanks!