The tag has no wiki summary.

learn more… | top users | synonyms

64
votes
5answers
25k views

In bash, how do I escape an exclamation mark?

I want to do something like bzr commit -m "It works!". I can sort of escape the exclamation mark by doing bzr commit -m "It works\!". However, then my commit message includes the backslash. How do I ...
26
votes
4answers
66k views

How do I escape spaces in command line in Windows without using quotation marks?

For example what is the alternative to this command without quotation marks: CD "c:\Documents and Settings" The full reason I don't want to use quotation marks is that this command DOES work: ...
21
votes
4answers
13k views

Escaping a password using mysqldump console

I am running a mysqldump via a bash script and have encountered a problem with a password that contains special characters. mysqldump -hlocalhost -uUSERNAME -pPA$$W0RD DATABASE | ...
13
votes
3answers
6k views

Escaping apostrophe in single quotes string in bash

I don't understand how Bash evaluates escaping of apostrophe characters in single quoted strings. $ echo ''\''Hello World'\''' 'Hello World' #works $ echo '\'Hello World\'' > # expects you to ...
13
votes
2answers
5k views

Excel Conditional Formatting Escaping a Question Mark

I would like to use a conditional formatting rule in an excel file that would color any box with a question mark in it red. It seems that Excel is using a question mark as a wild card and will turn ...
11
votes
5answers
14k views

Is there a way to escape single-quotes in the shell?

E. g. I want to say perl -e 'print '"'"'Hello, world!'"'"', "\n";' Is there a less awkward way to do it, e. g. escaping single-quotes? Yes, I know that I can write perl -e 'print q[Hello, ...
10
votes
2answers
2k views

How can I tell Vim to show ANSI escape codes properly?

I'm trying to view and edit a file in Vim, but this file has ANSI escape codes: ^[[1m[0.05s elapsed, 00:00:13 total]^[[0m How can I tell Vim to interpret them properly instead of just showing the ...
5
votes
3answers
2k views

How to escape file output for compatibilty with 'xargs'?

I have this command: find $1 | xargs touch But files with ' characters in their names fail with "xargs: unmatched single quote", and I guess other special characters would cause the same problem. ...
4
votes
2answers
1k views

get ubuntu terminal to send an escape sequence (control+shift+up)

This problem starts when I use emacs ( with -nw option). Let me first explain it. I tried to define hotkey (for emacs) as following (global-set-key [(control shift up)] 'other-window) but it ...
3
votes
1answer
1k views

How can I format this path to work as registry key value?

C:\Program Files (x86)\DotR\DotR.exe I know I need to escape the backslashes like C:\\Program Files (x86)\\DotR\\DotR.exe but it still doesn't work. Do I need to handle spaces and parens as special ...
3
votes
3answers
313 views

Need to sed awk or grep output to extract strings

I have output which looks like this: "vancouver/news/vancouver-voices": { "status": 0, "time": 0, "timestamp": 1371298701 }, "vancouver/news/vancouvers-march-second-annual-success": { ...
3
votes
2answers
425 views

ash scripting: space-containing variable refuses to be grepped

I am trying to run the script listed at http://talk.maemo.org/showthread.php?t=70866&page=2 on its intended hardware, a Nokia Linux phone running BusyBox ash. The script receives the name of WiFi ...
3
votes
3answers
1k views

How do I escape the string \" for command line in Windows?

For a script that compiles LaTeX for me, I have to send the string \" to the command line, within a string delimited by ". Example: >pdflatex "\IeC{\" o}" How do I escape the " in the middle? If ...
3
votes
0answers
563 views

Enabling Italics, Underline on Emacs, Xterm and Putty

I'm using a Ubuntu (11.04 Server Edition) virtual machine as my development environment. It doesn't have a desktop environment since I don't think its necessary and I want to keep it lightweight. I'm ...
2
votes
2answers
236 views

xbindkeys escape quotes

How can I escape quotes in .xbindkeysrc commands? Neither of those work. "pacmd dump|awk --non-decimal-data '$1~/set-sink-volume/{system ("pacmd "$1" "$2" "$3+2500)}'" "pacmd dump|awk ...
2
votes
1answer
2k views

How to use awk separator of single quote?

I'd like to use awk to pull out information from SQL output like the following: (count(distinct serverclass)='2') And need to extract the number, which is 2 in this example. I'd like to do ...
2
votes
2answers
2k views

Escaping %’s in file-/folder-names at the command-line

Does anybody of a way to access files and directories that have a % in their name (which is valid) from the command-line? Specifically, if there are two %’s and the text between them happens to ...
2
votes
1answer
367 views

How to convert Windows newlines to Unix newlines when cutting and pasting into Putty window?

Working on Windows XP Notepad++ with Windows line endings. When copying and pasting multiple lines into Putty window (connected to Ubuntu machine), it sends weird control characters. How to convert ...
2
votes
1answer
2k views

How to correctly set GNU Screen to display currently running program in hardstatus

In bash, to display the name of the current program in the GNU Screen hardstatus line takes only two configuration lines. First, tell screen what the end of your prompt normally looks like, and supply ...
2
votes
4answers
2k views

Can't escape single quotes in shell

I'm trying to make a command to do a perl substitution on a batch of php files in a directory. The string I want to replace has single quotes in it, and I can't get it to properly escape the in shell. ...
2
votes
1answer
323 views

How to properly vim-escape a variable/register

For example, I want to highlight occurrences of the current yank register, i.e., :let @/=@" It works, unless @" has 'funny' stuff in it like backslash. I can do :let @/=escape(@", '\\') but ...
1
vote
2answers
2k views

Spaces in Linux environmental variables?

Given directory: /media/foo/can haz/bar, I have tried editing bash.rc with: export Foo=/media/foo/can haz/bar export Foo=/media/foo/can\ haz/bar export Foo='/media/foo/can haz/bar' export ...
1
vote
3answers
3k views

Copy multiple files via cp from a string

I'm trying to copy multiple files to a directory from within a shellscript. These files contain all sorts of "ugly" characters, such as whitespaces, brackets and what not else. However, I'm stuck when ...
1
vote
1answer
50 views

Vim cursor pauses when typing backslash

I use vim as my primary text editor, and one (seemingly) useless attribute is that when I type the \ character, the cursor doesn't move for a moment or until I type another character. Functionally, ...
1
vote
1answer
2k views

how do I open a file from bash when it contains brackets

A previous developer on my project created backup copies of files using the format "filename (date time).extension" even though the project was under SVN control (don't ask!!!). I now can't open ...
1
vote
1answer
1k views

Upload a file with a comma in its name with curl

How can I upload a file named yes, this filename has a comma.txt with the cli curl? You would normally do this to upload a file with curl: curl --progress-bar -F "fileUpload=@filename.txt" However ...
1
vote
1answer
261 views

How to escape “-” in bash [duplicate]

Possible Duplicate: Unix tools: what if a file is named minus something? Please tell me how to escape this: [root@unix ~]# ./-sh -bash: ./-sh: Permission denied [root@unix ~]# chmod +x ...
1
vote
1answer
739 views

Generating the escape sequences for terminal by ahk

I am trying to make an ahk for putty to send the keycodes that I want for some key combinations in order for my program to work over terminal too. For this I have an ahk already with some key ...
1
vote
1answer
373 views

Why does gnome-terminal display a unicode escape character?

More specifically, in Vim if I press escape twice (and under some other circumstances too) I get this character appearing: http://www.fileformat.info/info/unicode/char/1b/index.htm It can be ...
1
vote
1answer
290 views

“^@” characters shown in SSH connection from OS X to Linux server

When I SSH into a Linux server via iTerm on OS X, running a PHP script, there are some strange characters printed on the screen What is this ^@ representing? These characters are not generated ...
1
vote
1answer
415 views

Display escape characters in tmux

I have a script on my mac that displays the battery level with some color output. The color is based on the battery leve. As the level goes to zero, the color goes from green to red: #!/bin/bash ...
1
vote
1answer
368 views

Using find and sed to rename several subfolders

What I am trying to do is rename folders that are anywhere in the current tree, not neccessarily directly in the working directory. What I need to do is: "A 1" becomes "A 01" "A 2" becomes "A 02" ...
1
vote
1answer
127 views

How can I escape the key-modifier characters in Texter?

In Texter's script mode, the ! character is used to denote the Alt key. I want the script to actually type a ! character -- how can I escape this so it will work? In the text mode (not script ...
1
vote
1answer
358 views

How can I use Control+` (grave accent) as my escape character for screen?

I've been trying to think of an escape character to use for screen that isn't already used by any of the programs I use, and I've settled on Ctrl+`. The default Ctrl+a is unacceptable for me because ...
1
vote
1answer
1k views

How do I export HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe with regedit from cmd.exe?

I am trying to export the registry key HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe but am unable to do so, probably because of the percent signs. I tried to escape the %-sign with a caret ...
1
vote
2answers
756 views

Escape sequences in virtual terminal

I need send next escape sequence through COM port. ^[[LD NOTE (from manual) Pressing "Ctrl-v", "Ctrl-[" on keyboard will generate the "^[" escape sequence. In some file systems, the escape ...
0
votes
2answers
58 views

cmd.exe escapes two quotes next to each other, even though my first quote is escaped by a caret

I am having troubles with quotes, I've been at this for hours... I basically have a external program (FOO) and it needs a string to process, and within that string there is a quote in the end and in ...
0
votes
2answers
4k views

What is the ^I character and how do I find it with sed?

I usually import data from csv files to MySQL, but my data provider leaves NULL entries as "", so I need to replace "" with "\N". This is easy enough with a script like for csvfile in *.csv do ...
0
votes
3answers
677 views

How to convert Windows filenames (from a checksums.md5) to *nix notation so I can use it on my shell with md5sum?

I have some checksums.md5 verification files from an ntfs external drive, but using windows notation: \ instead of /, spaces between file names (not escaped), reserved shell characters (like (, &, ...
0
votes
2answers
318 views

Shell scripting: handling currency arguments

I want to run a script that takes arguments in a currency format. Example: > ./myscript $55.50 total is $55.50 > ./myscript $3.40 total is $58.90 Now, no matter how hard I try to escape the ...
0
votes
2answers
342 views

How can I add a folder containing a semicolon to the Windows PATH?

I noticed that the semicolon ; is a valid character for Windows (NTFS) file and directory names. The semicolon is, however, used as element delimiter for the PATH environment variable. Say I have a ...
0
votes
1answer
248 views

How to escape “!” and “&” in docker's environment varibles

I have a docker container I want to run and hand it over some passwords. One with an exclamation mark ! and the other one with an ampersand &. So I want to run this: docker run -i -t --rm \ -e ...
0
votes
1answer
76 views

GNU Screen - String Escapes

Can somebody please explain or point me to good tutorial about "String Escapes" used in ~/screenrc. I am playing with $PS1 and ~/.screenrc. While $PS1 seems pretty clear (colors, conditions, escape ...
0
votes
2answers
852 views

Escaping exclamation mark in shell (negation for if/then construct)?

I often use this directly in a shell to test an outcome for scripting, and it works fine: $ if [ -d mydirectory ] ; then echo YES ; fi YES However, if I want to use the negation using exclamation ...
0
votes
1answer
257 views

remap gnu screen “other” window selection

In my .screenrc file, I have: escape \034\034 This remaps ^a to ^\. This works for switching windows when specifying the window number, such as ^\0 or ^\1 but the 'other' command is not available, ...