chippymike
Technical User
Hi,
I need to write a script that will prompt the user, through a menu, to move all files which match a particular search string (*.abc*) within a directory to a target directory.
I need the user to be prompted for every file, not just files which already exist in the target directory (mv -i is therefore not an option).
Creating the menu option is no problem but the syntax of the script which will give it its functionality has got me pulling my hair out!
I have the following so far;
for file in `find /dir_path -name "*.abc*" -print`
do
mv -i $file /target_path
done
I know I'm probably quite far off the mark so any help is greatly appreciated!
Cheers
I need to write a script that will prompt the user, through a menu, to move all files which match a particular search string (*.abc*) within a directory to a target directory.
I need the user to be prompted for every file, not just files which already exist in the target directory (mv -i is therefore not an option).
Creating the menu option is no problem but the syntax of the script which will give it its functionality has got me pulling my hair out!
I have the following so far;
for file in `find /dir_path -name "*.abc*" -print`
do
mv -i $file /target_path
done
I know I'm probably quite far off the mark so any help is greatly appreciated!
Cheers