The escape-characters tag has no wiki summary.
0
votes
2answers
31 views
Why escaped single quote doesn't work in grep?
I am trying to match a string:
* * * * * /usr/local/bin/growlnotify -t 'helloTitle' -m 'helloMessage' -n 'myApp' -sw
with:
crontab -l | grep '^[^#].*/usr/local/bin/growlnotify.*\-n \'myApp\'.*$'
...
0
votes
1answer
25 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 ...
0
votes
2answers
50 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 ...
1
vote
3answers
285 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
56 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 ...
3
votes
2answers
111 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 ...
1
vote
1answer
284 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
322 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 ...
10
votes
3answers
742 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 ...
2
votes
1answer
137 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 ...
2
votes
1answer
419 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 ...
0
votes
1answer
204 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
197 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
2answers
313 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
1answer
164 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 ...
2
votes
2answers
510 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
2answers
95 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 ...
1
vote
1answer
257 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
...
2
votes
1answer
151 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 ...
5
votes
2answers
976 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 ...
0
votes
2answers
387 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 (, &, ...
3
votes
0answers
326 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 ...
1
vote
1answer
159 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 ...
0
votes
2answers
473 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 ...
1
vote
1answer
80 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
222 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 ...
0
votes
2answers
1k 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
...
1
vote
1answer
444 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 ...
10
votes
3answers
21k 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:
...
4
votes
3answers
935 views
Escape files 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.
...
2
votes
2answers
896 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 ...
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 ...
3
votes
3answers
511 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 ...
0
votes
1answer
239 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, ...
1
vote
2answers
180 views
How do I change the sound used for the Ctrl-G system alert beep?
For an experiment I'm running (I'm a grad student in Psychology), I would like to be able to change the system alert beep (aka Ctrl-G aka ASCII 07 aka the \a escape sequence in C and its cousins) to a ...
0
votes
2answers
168 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 ...
7
votes
2answers
2k 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 ...
39
votes
5answers
9k 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 ...
2
votes
4answers
1k 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. ...
12
votes
4answers
5k 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 |
...
6
votes
4answers
7k 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, ...