Question mark in filename


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Question mark in filename
# 1  
Old 09-04-2009
Question mark in filename

Dear All,

I am trying to run some commands and I am getting question mark in filename as output files.
Which is not a literal question mark however it is not standard output format for UNIX and it can not print it.
The output files are extended with ?
For example, Chr1_CPSII_phase_results?_hbg instead of Chr1_CPSII_phase_results_hbg
I can change it with mv command but there are lots of files. Is there any easier way to do so?
Thanks again,
Hemang
# 2  
Old 09-04-2009
Maybe something like this:

Code:
for file in *; do mv "$file" "$(echo $file | sed s'/\?//g')"; done

# 3  
Old 09-04-2009
Dear Cabrao,

Thank you so much!
It worked fine with

for file in *; do mv "$file" "$(echo $file | sed s'/\r//g')"; done

Thanks again,

Hemang
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Nawk command not working for Question mark (?)

Hi Folks, I am facing an issue with nawk command. The data is as below: ABC0022,BASC,Scene Package,INR,02May17,XXX4266,be?. Hotel,3,AW01,Twin Room,61272,41308,39590,39590,X,X ABC0022,BASC,Scene Package,INR,02May17,XXX4266,be?. Hotel,3,AW02,Twin Room with Balcony,9272,85638,4520,9590,X,X... (1 Reply)
Discussion started by: kirans.229
1 Replies

2. Programming

to extract all the part of the filename before a particular word in the filename

Hi All, Thanks in Advance I am working on a shell script. I need some assistance. My code: if then set "subscriber" "promplan" "mapping" "dedicatedaccount" "faflistSub" "faflistAcc" "accumulator"\ "pam_account"; for i in 1 2 3 4 5 6 7 8;... (0 Replies)
Discussion started by: aealexanderraj
0 Replies

3. UNIX for Dummies Questions & Answers

to extract all the part of the filename before a particular word in the filename

Hi All, Thanks in Advance I am working on a shell script. I need some assistance. My Requirement: 1) There are some set of files in a directory like given below OTP_UFSC_20120530000000_acc.csv OTP_UFSC_20120530000000_faf.csv OTP_UFSC_20120530000000_prom.csv... (0 Replies)
Discussion started by: aealexanderraj
0 Replies

4. Shell Programming and Scripting

Backwards question mark appearing in FTP'd file

Hi all, I'm trying to FTP what looks like a simple .txt file from my Windows XP desktop to my UNIX server. I've tried using several programs to do this including UltraEdit and FTP Commander. I have tried sending it ascii, binary and even let the program decide. But every time it arrives in UNIX... (4 Replies)
Discussion started by: Korn0474
4 Replies

5. Shell Programming and Scripting

Filename from splitting files to have the same filename of the original file with counter value

Hi all, I have a list of xml file. I need to split the files to a different files when see the <ko> tag. The list of filename are B20090908.1100-20090908.1200_CDMA=1,NO=2,SITE=3.xml B20090908.1200-20090908.1300_CDMA=1,NO=2,SITE=3.xml B20090908.1300-20090908.1400_CDMA=1,NO=2,SITE=3.xml ... (3 Replies)
Discussion started by: natalie23
3 Replies

6. Shell Programming and Scripting

gzcat into awk and then change FILENAME and process new FILENAME

I am trying to write a script that prompts users for date and time, then process the gzip file into awk. During the ksh part of the script another file is created and needs to be processed with a different set of pattern matches then I need to combine the two in the end. I'm stuck at the part... (6 Replies)
Discussion started by: timj123
6 Replies

7. UNIX for Dummies Questions & Answers

trailing question mark in filename

I have a script(ex.sh) with one line in it, running in bash shell. ls -l > /usr/ngasi/contexts/tdevoe/private/ex.txt when I run it , it creates the file with a trailing question mark -rwx------ 1 tdevoe webapp 59 Jun 7 06:42 ex.sh -rw------- 1 tdevoe webapp 3761 Jun ... (3 Replies)
Discussion started by: devoetfd
3 Replies

8. Shell Programming and Scripting

~mark

hi guys I am studing unix and I have some questions to ask. what is the diffrence beteween man and info? how and when we use ~ mark? tanks henk ;) (1 Reply)
Discussion started by: henk
1 Replies

9. UNIX for Dummies Questions & Answers

? question mark, how to get back to the root directory

hiyas I am trying to get back to the root directory: I went into MAIL directory and now I can't get back to the root directory. What are the commands... I have '?' coming up and I cannot proceed with this, HELP Cheers (1 Reply)
Discussion started by: etravels
1 Replies
Login or Register to Ask a Question