Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
2answers
42 views

Remove control characters from /var/log/boot.log

I have a script that sends out email to sysadmin group when a server is powered on or off. The email contains dump of some important logs like /var/log/messages, /var/log/secure, /var/log/boot.log . ...
5
votes
1answer
45 views

Representing/quoting NUL on the command line

Can \0 be used on the command line? Background For testing corner cases in GNU Parallel I was curious whether all characters were correctly quoted on the command line. Most of them are: perl -e ...
24
votes
8answers
2k views

Dealing with file names with special first characters (ex. ♫)

I have recently come across a file whose name begins with the character '♫'. I wanted to copy this file, feed it into ffmpeg, and reference it in various other ways in the terminal. I usually ...
0
votes
2answers
39 views

How to printf an exclamation point in tcsh?

What's the best way to printf an exclamation point in tcsh? It seems like using single or double quotes has no effect on escaping the exclamation point; and using a backspace does work, but then it ...
3
votes
2answers
126 views

How can I write a non-breaking space? [closed]

When I write a question, I'd like the space between the final word and the question mark to be non-breaking, and this very sentence is an example of it (this is why it is awkward), how can I do that ? ...
6
votes
2answers
193 views

How many commands can be queued up with control operators?

I have been reading up on control operators, and I was wondering if there was a limit to how many commands you could line up with control operators, such as ||, && and ;. In addition, is ...
-1
votes
0answers
22 views

replace $ with £ using sed command [duplicate]

I have text file DollarToPound.txt with some Dollar signs ($) please provide a shell script to replace dollar symbol with Pound(£) with sed command. iam getting command garbled error!!! please help. ...
1
vote
1answer
66 views

Forcing the system to allow me to insert any character in the file name

I had an exam this week, and one of the questions was (with one correct answer): The file name can contain the character: a) \ b) / c) ? d) ! I chose c) ? because it looked ...
1
vote
2answers
216 views

printing special characters in awk output

I have a large file that contains lot MQ messages with RFH2 header. Each message in the file is separated by a blank line. Now I need to split this large file into small files each containing single ...
2
votes
1answer
134 views

csplit not obeying backslash r \r as carriage return

I have a file with \r\n line endings (CRLF carriage return line feed). This command works: $ csplit --silent --prefix=email-emailbad.txt- \ --digits=3 emailbad.txt '/^\.^M/'+1 '{*}' This ...
2
votes
1answer
121 views

What is the ` character or symbol called and what is its significance outside of SE code formatting? [duplicate]

What is the ` character's name and what is its significance outside of SE code formatting because I cannot get it to work? I'm familiar with its use in the Stack Exchange forums used to format code ...
11
votes
7answers
2k views

What is the symbol *.* called?

What's the name for the *.* symbol and what is its significance?
2
votes
2answers
147 views

How to rename filename with ' or ? in file name?

I have a problem renaming a file that I'm not even sure which special characters I have in the file. I'm using CentOS 6 64bit. When I ls the file: Giko Suzo San?e - Ep1.avi but when view it in ...
2
votes
2answers
116 views

Very strange ls > textfile problem when viewing with emacs

I want to list the components of the current working directory in a text file ls -1 > textfile Output looks fine with more. 1010661085645 1010729039145 1010747080245 1010849051345 ...
1
vote
1answer
324 views

Sed: search and replace a patten with special characters which has a arbitrary string in between

I have a load of nfo files which I want to make some global substitutions for some values within each file e.g. a.nfo has the value <set>Tonight&apos;s Menu ( June 2012 )</set> ...
2
votes
2answers
400 views

delete directory with special character in filename

I have these tricky directories that I can't figure out how to delete. If I run ls -ld * I get… drwxrwxr-x 7 user1 taskfmri 2048 Jan 22 15:26 857263 drwxrwx--- 4 user2 ...
4
votes
3answers
737 views

Help Shell script to pass variables to rsync

I'm trying to create a simple wrapper shell script for rsync. When I send file names to my script, rsync can never seem to identify the correct location. The file names have spaces in them. I've tried ...
3
votes
5answers
704 views

What are the special characters to print from a script to move the cursor?

I found that by printing \r from a script the cursor moves to the beginning of the line. What character will move the cursor up one line? Where is a list of these special characters? EDIT: Working ...
1
vote
1answer
94 views

What's the practical difference between `command` and $(command)? [duplicate]

Both give the output of the command, so what is the semantic difference between the two? Some reading led me to suspect is that $(command) is Bash syntax, and the back quotes are integrated into Unix ...
-1
votes
2answers
193 views

How can I force sed to continue parsing when it hits an “invalid” character?

I have a big playlist in .pls format (created with deadbeef playing software) which also contains some badly-encoded strings. Whether this is a bug in deadbeef or one of its plugins does not really ...
2
votes
1answer
132 views

What characters TAR doesn't like?

I keep a list of photos burned to dvds for incremental backups but I got into a strange situation where a file was already burned into a dvd but tar keeps saying it's not. Here the steps to reproduce: ...
2
votes
1answer
716 views

Double line box_drawing characters in terminal

This piece of code in wikipedia: $ char=( 6a 6b 6c 6d 6e 71 74 75 76 77 78 ) $ for i in ${char[*]}; do printf "0x$i \x$i \e(0\x$i\e(B\n"; done includes one-line box-drawing characters. Are there ...
4
votes
4answers
3k views

How to grep for pipe |

How can I grep for line containing pipe character | or for character >: files content: |this is test where is > this is none now what I need using grep command is grep -iE "<some ...
0
votes
3answers
160 views

How to delete directory ' :q!'? [duplicate]

Accidentally, i have got this directory created in my home, drwxr-xr-x 2 ubuntu ubuntu 4.0K 2012-09-06 07:27 :q!/ I want to remove this somehow. I have tried using escape characters in double ...
2
votes
4answers
3k views

sh and grep numbers only

I'm facing a problem and trying to find a solution that works in sh. If I could use bash this code would work: ls /a|grep ^[0-9] Unfortunately this is not the case with sh, and yes I need to use ...
2
votes
2answers
2k views

What does the tilde (~) mean at the end of a filename? [duplicate]

What is the file with the ~ at the end of the filename for? $ ls # aliased to add flags -rwxrwxr-x 1 durrantm 2741 May 16 09:28 strip_out_rspec_prep_cmds.sh~* drwxrwxr-x 13 durrantm 4096 May 16 ...
52
votes
7answers
3k 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
754 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
61 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
244 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
287 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
4k 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 ...
8
votes
2answers
454 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
227 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
264 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 ...
14
votes
3answers
3k 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
285 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
215 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): ...
4
votes
2answers
1k 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). ...
15
votes
3answers
8k 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: ...
8
votes
5answers
4k 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
594 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
103 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?
6
votes
2answers
3k 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
243 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?
5
votes
5answers
505 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?
3
votes
4answers
1k 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
202 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 ...
7
votes
6answers
2k views

how to type “smart quotes” (U+201C, U+201D)

It's like this: “ (U+201C) ” (U+201D).
3
votes
1answer
415 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 "" ...