The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Remove trailing G Heathe_Kyle Shell Programming and Scripting 3 04-14-2008 11:56 AM
shortcut for tar cvf - [filename] | gzip > [filename].tar.gz bcamp1973 UNIX for Dummies Questions & Answers 4 12-11-2007 05:45 PM
~mark henk Shell Programming and Scripting 1 04-23-2006 10:12 AM
? question mark, how to get back to the root directory etravels UNIX for Dummies Questions & Answers 1 02-05-2004 06:14 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-07-2006
devoetfd devoetfd is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 1
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 7 06:42 ex.txt?

why?
  #2 (permalink)  
Old 06-08-2006
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,960
I think you've got gremlins.



"Gremlin" is a colorful term for strange, nonprinting characters that your text editor might not show you but can really foul things up anyway. That's not a literal question mark, it's ls thinking "What the hell is that? I can't print that!" so it just prints a question mark instead. Gremlin characters are even more annoying in C files, the compiler just dies.

I often get lots of gremlins from copy/pasting stuff from the internet. If that's how you ended up with that one, there's probably lots more.

You can get rid of gremlins like:
Code:
tr -d '[\000-\010\014\016-\037\177]' < messed-up.sh > fixed.sh
This will strip out any characters but ASCII printing characters, newline, carriage return, tab, and space.

P.S. Don't feed them
  #3 (permalink)  
Old 06-09-2006
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,770
A lot of editors have a hex display mode. I use Ultra Edit for finding embedded junk characters, and dos2ux to clean up files brought over from Windows systems.
  #4 (permalink)  
Old 06-09-2006
thestevew thestevew is offline
Registered User
  
 

Join Date: Mar 2006
Location: South Yorkshire, UK
Posts: 114
You could try "ls -b" to display any gremlin characters in octal notation (\nnn)
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:14 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0