![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Remove trailing G | Heathe_Kyle | Shell Programming and Scripting | 3 | 04-14-2008 07:56 AM |
| shortcut for tar cvf - [filename] | gzip > [filename].tar.gz | bcamp1973 | UNIX for Dummies Questions & Answers | 4 | 12-11-2007 02:45 PM |
| ~mark | henk | Shell Programming and Scripting | 1 | 04-23-2006 06:12 AM |
| ? question mark, how to get back to the root directory | etravels | UNIX for Dummies Questions & Answers | 1 | 02-05-2004 03:14 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#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? |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
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 P.S. Don't feed them |
|
#3
|
|||
|
|||
|
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
|
|||
|
|||
|
You could try "ls -b" to display any gremlin characters in octal notation (\nnn)
|
|||
| Google The UNIX and Linux Forums |