needed opinion on the below code
I am planning to delete few files from a subdirectory, my aim is to locate all *.des files, remove them all except the one which the user specifies.here is the code i wrote which is not coming out right. des1 is already existing in the folder, and i am copying that to a new file with a different name and deleting all the *.des files in that folder.
one more thing is, that there are also other type of files in the directory. so i just want to remove only the *.des files keeping the only one which the user specifies.
echo "Enter Des File name"
echo " Enter the 5 digit name"
cp $des1 $des2
for i in `ls .`
rm -f $i/*.des
i know that above code removes all *.des files, wat command do i add to exclude that particular user given file.
if you point me to the command name , i will figure out the code...
Last edited by neo2k; 03-09-2009 at 11:10 AM.
Reason: Updated the description.