The special-characters tag has no wiki summary.
33
votes
5answers
1k views
How safe is it to cat an arbitrary file?
Sometimes when I cat a binary file by mistake, my terminal gets garbled up. Nothing a quick reset can't fix, but couldn't an attacker theoretically create a file that, when displayed on a terminal, ...
1
vote
1answer
130 views
tr command not working with octal sequences
I need to strip non-ASCII characters off a file. I was using the command -
/usr/xpg4/bin/tr -cd '\0-\177' <non-ASCII_file.dat >ASCII_file.dat
Though it worked in the past, it is not ...
0
votes
1answer
30 views
What characters in my printed boot scroll are artifacts?
I am a tech writer and I need to include a boot dump in a document. The dump the engineers gave me has some "bad characters" that I need to delete. What form does a "bad character" take? There are ...
2
votes
1answer
122 views
tcsh vs zsh. Escape/control characters
I am having problems running this command to work in zsh:
my_command -u something -s X:^0
The command works right away on tcsh, but on zsh I get:
zsh: no matches found -s X:^0
This made me ...
3
votes
2answers
88 views
Hash symbol on a teletype
My issue is a bit unusual, so I want to provide a short background. I was looking at old winners of the International Obfucated C Code Contest, and came across an entry written for the PDP-11 (the ...
2
votes
1answer
874 views
sed special character replace not working in shell script
I want to write a script 'test.sh' that will take a user's input and replace all special characters with a '\' + the character. My script:
#!/bin/bash
echo 'input='"$1"
arg=`echo "$1" | sed ...
7
votes
2answers
247 views
Command line input while a running script displays strange symbols
If I use the bash shell cli and run some program which doesn't return immediately, then I input some letters (basically typing the next command before noticing the previous didn't finish) and the ...
2
votes
1answer
126 views
Control character STTY issue
I am changing control character (e.g- ^C) using
stty intr ^_
under root privileges. It changes successfully.
But when I am closing terminal and opening terminal again to check whether same ...
0
votes
1answer
169 views
Checking existence of file with underscore in file name in zsh
I am writing a very simple script which will link shared configuration files. For some reason it does not behave as i expected for file with underscore in name. Does _ (underscore) means something ...
9
votes
3answers
1k views
Understanding Unix file name encoding
I have a hard time understanding how the file name encoding works. On unix.SE
I find contradicting explanations.
File names are stored as characters
To quote another answer:
Several questions about ...
7
votes
2answers
228 views
Why doesn't `echo abc^H` just print `ab`?
As I recall, ^H means Backspace. I generated it by pressing CTRL+V, CTRL+H.
So the ^H should remove the last character, as it is the same as Backspace and it should act just as if I pressed Backspace ...
2
votes
0answers
127 views
Locate enscript reported non-printable chars
I'm making a postscript of a bunch of C code, and enscript reports I have 2 non-printable chars
[ 91 pages * 1 copy ] left in a.ps
2 non-printable characters
non-printable character codes (decimal):
...
1
vote
2answers
490 views
Is There A Way To Find Files Containing Only Non-Printing Characters?
I've got a program that's behaving badly and has created a number of files with only a few non-printing characters. If I were to cat the files, I see nothing (since they are non-printing chars). ...
11
votes
3answers
2k views
Can't use exclamation mark (!) in bash?
I'm trying to use the curl command to access a http url with a exclamation mark (!) in its path. e.g:
curl -v "http://example.org/!287s87asdjh2/somepath/someresource"
the console replies with bash: ...
7
votes
5answers
461 views
What is `^M` and how do I get rid of it?
When I open the file in vim I am seeing strange ^M characters.
Unfortunately, the world's favorite search engine does not do well with special characters in queries, so I'm asking here:
What is ...
6
votes
1answer
226 views
How to detect and delete lines containing ˆ@
I have a simple problem:
In my file, the are lines containing the string ˆ@ˆ@ˆ@ˆ@ˆ@ˆ@. I just want to delete all lines with this string, using for example the sed or grep commands.
And I would like ...
1
vote
2answers
79 views
Narrow characters
It would be awesome to modify spark to print narrow characters in for example Gnome Terminal. Is this at all possible with Bash / Python?
4
votes
2answers
1k views
special character in filename (\#033OA)
I've got a slight problem with a very stubborn error during an rsync. It's caused by a file with a special character in its filename. There's been others but I could sort that out by doing some ...
2
votes
1answer
127 views
Modifying a set of binary files
I have several binary files with the character 0x04 in them, and I'd like to add an escape \ character before each. Is there a script I can use to do this without needing to manually edit each one?
3
votes
4answers
330 views
How do I remove a file I accidentally created named $file?
I was working on a shell script and I accidentally created a file with the variable as its name. Now I have $file in my ls output, and cannot remove it. What can I do?
2
votes
3answers
826 views
Matlab gets “crazy” after type special characters
I'm using a computer running Ubuntu and I'm connected through ssh to a RedHat machine where I use Matlab in command line mode (matlab -nodesktop). Matlab version is 7.10.0.499 (R2010a).
My problem ...
4
votes
2answers
153 views
Strange encoding in Slackware
I am a student and learning about operating systems, I was modifying a file using vi, when I accidentally did something (I don't remember what) that change the codification/encoding and now this is ...
6
votes
5answers
698 views
3
votes
1answer
280 views
Difference between ' and " on command line (bash)?
I used to use '' and "" interchangeably on the command line, but I recently noticed that '$HOME/some/dir' is not expanded, while "$HOME/some/dir" is. I searched around a little bit and found that "" ...
7
votes
4answers
1k views
How do I type the degree symbol under X11 (using a default English keyboard layout)?
I'm trying to put in an email the temperature outside in degrees. On my Mac, the degree symbol (°) is Option+Shift+8. But I'm writing the email in Thunderbird on an Ubuntu 10.10 with the default US ...
6
votes
2answers
6k views
What does ^d mean in ls -l | grep ^d?
When I do ls -l | grep ^d it lists only directories in the current directory.
What I'd like to know is what does the caret ^ in ^d mean?
9
votes
3answers
7k views
How do I put a hat on 'e' (ê)?
Since I've migrated to linux a few years ago, one issue still remains.
The ê character features a lot in my "moeder taal" (home language).
In Windows making the character was easy, I simply had to ...