Using rm to remove windows shell file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Using rm to remove windows shell file
# 1  
Old 04-14-2015
Using rm to remove windows shell file

I am trying to remove several files in a specific location using rm , my question is how can windows shell common files be removed? For example, in the below code all the files without and extension after are windows shell common. Thank you Smilie.

Code:
rm 'C:\Users\cmccabe\Desktop\annovar\"${id}".txt.hg19_clinvar_dropped'
  rm 'C:\Users\cmccabe\Desktop\annovar\"${id}".txt.hg19_clinvar_filtered'
  rm 'C:\Users\cmccabe\Desktop\annovar\"${id}".txt.hg19_clinvarreferece_dropped'
  rm 'C:\Users\cmccabe\Desktop\annovar\"${id}".txt.hg19_clinvarreference_filtered'
  rm 'C:\Users\cmccabe\Desktop\annovar\"${id}".txt.hg19_clinvarsubmit_dropped'
  rm 'C:\Users\cmccabe\Desktop\annovar\"${id}".txt.hg19_clinvarsubmit_filtered'
  rm 'C:\Users\cmccabe\Desktop\annovar\"${id}".txt.hg19_common_dropped'
  rm 'C:\Users\cmccabe\Desktop\annovar\"${id}".txt.hg19_common_filtered'
  rm 'C:\Users\cmccabe\Desktop\annovar\"${id}".txt.hg19_popfreq_all_dropped'
  rm 'C:\Users\cmccabe\Desktop\annovar\"${id}".txt.hg19_popfreq_all_filtered'
  rm 'C:\Users\cmccabe\Desktop\annovar\"${id}".txt.log'
  rm 'C:\Users\cmccabe\Desktop\annovar\"${id}".txt.refGene.exonic_variant_function.xlsx'
  rm 'C:\Users\cmccabe\Desktop\annovar\"${id}".txt.refGene.txt'
  rm 'C:\Users\cmccabe\Desktop\annovar\"${id}".txt.refGene.variant_function.xlsx'

# 2  
Old 04-14-2015
No clue what "windows shell common files" would be. Above would not work as within the single quotes, the double quotes are taken literally, and $id will not be expanded.
This User Gave Thanks to RudiC For This Post:
# 3  
Old 04-15-2015
Thank you Smilie.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need regex shell script to remove text from file

Hello I am trying to remove a line like <?php /*versio:2.05*/if (!defined('determinator')){ content goes here}?> Now i want to scan all... (6 Replies)
Discussion started by: devp
6 Replies

2. UNIX for Dummies Questions & Answers

Shell input to remove every second file in a directory

Hey guys, I am looking for simple shell script, so i can remove every second file in a directory. For example in any given directory there are 10.000 files: 0001.jpg 0002.jpg 0003.jpg 0004.jpg 0005.jpg 0006.jpg 0007.jpg 0008.jpg .... 1111.jpg 1112.jpg etc. After running the... (5 Replies)
Discussion started by: alpha_mouse
5 Replies

3. Shell Programming and Scripting

Shell script to remove oldest file

Hi, I have two set of files in a directory called /tmp/backup. I want to write a script to remove the oldest of these two, so that there is space available for a newer similar backup file. For example, I have /tmp/backup/dbbackup_dbname_121223112 (oldest)... (4 Replies)
Discussion started by: welldone
4 Replies

4. Shell Programming and Scripting

Shell script to remove some content in a file

How can I remove all data that contain domain e.g zzgh@something.com, sdd@something.com.my and gg@something.my in one file? so that i only have data without the domain in the file. Here is the file structure "test.out" more test.out 1 zzztop@b.com 1 zzzulll 1 zzzullll@s.com.my ... (4 Replies)
Discussion started by: Mr_47
4 Replies

5. Shell Programming and Scripting

How to remove particular line from file through shell script?

Hi, I am pasring a file line by line. I need to check each field in line and remove particular line. input file lines are, 02;ABC;PQR 03;aaa;rrr 04;ABC;ggg 09;eee;ABC 04;lmn;stu I am looking for line containing "ABC" as field value. Now How can I remove this line from input file... (7 Replies)
Discussion started by: Poonamol
7 Replies

6. Shell Programming and Scripting

Shell Script to remove spaces while writing to the file

Hello Folks, I want to get the results from a SQL query which needs to be exported to a .txt file. My Script is something like #!/bin/ksh db2 connect to DATABASE user user_name using pwd; touch test.txt isResult=0; isResult= `db2 -x select 'ABC',COL_B from TABLE_A WHERE COL_B=CONDITION`... (6 Replies)
Discussion started by: dinesh1985
6 Replies

7. UNIX for Dummies Questions & Answers

Watch for File on Windows share using Shell Script

I want to poll a particular file on a Windows shared drive using shell script and copy it to a Unix directory if present. Step wise execution: 1) Poll/watch for a file in the following location on Windows share: (SRC_DIR=\\mum\dharmesh\research\ST_DXR_20080821 to DXR.xls) 2) If present,... (1 Reply)
Discussion started by: dharam_v
1 Replies

8. Shell Programming and Scripting

Watch for File on Windows share using Shell Script

Watch for File on Windows share using Shell Script I want to poll a particular file on a Windows shared drive using shell script and copy it to a Unix directory if present. Step wise execution: 1) Poll/watch for a file in the following location on Windows share:... (1 Reply)
Discussion started by: dharam_v
1 Replies

9. Shell Programming and Scripting

Shell to FTP file from Windows to unix

I need your help for a FTP Job to be schedule to copy files from windows to Unix. in a set of time interval. My requirement is as follows. 1.Script should check whether file is available in the windows folder , if available then do FTP to unix server , and then move... (3 Replies)
Discussion started by: sandeep.kamble
3 Replies

10. Shell Programming and Scripting

how to remove ^M from windows text file in unix

Hi, Need help on windows text file that i get in unix server and need to change and resend for process. Now there is a ^M will be placed for each line of that file i need that to be removed . Someone please help me. Thanks in advance for all help. (1 Reply)
Discussion started by: pragy1999
1 Replies
Login or Register to Ask a Question