how to delete file names with $ in them


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers how to delete file names with $ in them
# 1  
Old 04-11-2008
how to delete file names with $ in them

I'm reading the file name from a spreadsheet then creating a data file with several remove statements.

i.e
cd /sun/5.0/AWBE/v1.0/svr/VaultLocs/CPVaultLoc/
rm "ZXCV KTest Stat host $$ cont.xls"
cd /sun/5.0/AQE/v1.0/svr/VaultLocs/CPVaultLoc/
rm "ABC PMT OzLtr.pdf"
cd /sun/5.0/AAAE/v1.0/svr/VaultLocs/CPVaulttLoc/
rm "QWE Labor ST Rest $1.9 1 Mar 00).pdf"



Some file names have special characters in them, such as "$" and aren't getting deleted.

how do I delete these files?


thanks,
# 2  
Old 04-11-2008
Some possiblities supposed you have a file like "file$xyx":

Code:
rm 'file$xyx'
rm file\$xyx
rm file?xyx

Regards
# 3  
Old 04-11-2008
I thought the double quotes picked up the special characters, but it looks like it doesn't


thanks,

Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete files except the file names available in the Except File

Hi, I need some help in the below scenario. I need to delete all the files from the directory except the file name available in the Except file. Like the folder ABC have files like A1.txt,A2.txt......A10.txt and also have a file named Except.txt with the content A3.txt,A4.txt Need a... (6 Replies)
Discussion started by: kban
6 Replies

2. Shell Programming and Scripting

Exclude certain file names while selectingData files coming in different names in a file name called

Data files coming in different names in a file name called process.txt. 1. shipments_yyyymmdd.gz 2 Order_yyyymmdd.gz 3. Invoice_yyyymmdd.gz 4. globalorder_yyyymmdd.gz The process needs to discard all the below files and only process two of the 4 file names available ... (1 Reply)
Discussion started by: dsravanam
1 Replies

3. Shell Programming and Scripting

Checking Multiple File existance in a UNIX folder(Note: File names are all different)

HI Guys, I have some 8 files with different name and extensions. I need to check if they are present in a specific folder or not and also want that script to show me which all are not present. I can write if condition for each file but from a developer perspective , i feel that is not a good... (3 Replies)
Discussion started by: shankarpanda003
3 Replies

4. Shell Programming and Scripting

Change the file name and copy old file content to new file names.

Hi, I have a files in a directory as below :- ls -1 mqdepth-S1STC02 proc-mq-S1STC01 proc-mq-S1STC02 proc-mq-S1STC03 Whereever i have S1STC i need to copy them into new file with file name S2STC. expected output :- ls -1 mqdepth-S2STC02 proc-mq-S2STC01 proc-mq-S2STC02... (3 Replies)
Discussion started by: satishmallidi
3 Replies

5. UNIX for Dummies Questions & Answers

Delete files whose file names are listed in a .txt file

hi, I need a help. I used this command to list all the log files which are for more than 10 days to a text file. find /usr/script_test -type f -mtime +10>>/usr/ftprm.txt I want all these files listed in the ftprm.txt to be ftp in another machine and then rm the files. Anyone can help me... (8 Replies)
Discussion started by: kamaldev
8 Replies

6. Shell Programming and Scripting

Split File by Pattern with File Names in Source File... Awk?

Hi all, I'm pretty new to Shell scripting and I need some help to split a source text file into multiple files. The source has a row with pattern where the file needs to be split, and the pattern row also contains the file name of the destination for that specific piece. Here is an example: ... (2 Replies)
Discussion started by: cul8er
2 Replies

7. Shell Programming and Scripting

Searching for file names in a directory while ignoring certain file names

Sun Solaris Unix Question Haven't been able to find any solution for this situation. Let's just say the file names listed below exist in a directory. I want the find command to find all files in this directory but at the same time I want to eliminate certain file names or files with certain... (2 Replies)
Discussion started by: 2reperry
2 Replies

8. Shell Programming and Scripting

Compare 2 list and delete certain names

Hi, I currently have a script that takes a list of names and compares it with another list and appends non-duplicate names. I want to modify my script such that it will look at a list of names and for every name preceded by the tag "<delete>" (without the quotes) it checks the other list for... (12 Replies)
Discussion started by: eltinator
12 Replies

9. Shell Programming and Scripting

Reading file names from a file and executing the relative file from shell script

Hi How can i dynamically read files names from a list file and execute them from a single shell script. Please help its urgent Thanks in Advance (4 Replies)
Discussion started by: anushilrai
4 Replies

10. UNIX for Dummies Questions & Answers

How can I delete files using a file that containt path and names?

Recentily i receive virus ninda and my network was files *.eml. I find all *.eml with: find / -name *.eml -print > virus Virus has the path and name of the file,so, How can i delete all *.eml? Thanks (2 Replies)
Discussion started by: AlvaroD
2 Replies
Login or Register to Ask a Question