Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [escape-characters]

The tag has no usage guidance.

2
votes
1answer
51 views

What's wrong with this PS1-Prompt?

I was styling my PS1-Prompt to resemble the iPython-Prompt as: PS1FIRSTLINE="\[\n\][\t] \[\e[1m\e[38;5;196m\]\u@\H\[\e[0m\] in \[\e[1m\e[38;5;196m\]\w\[\e[0m" PS1SECONDLINE="\n\e[92m\]In [\[\e[1m\]\#\...
2
votes
1answer
87 views

Masking Reserved Words in Windows Command Line

I have a Java program that I need to launch with a command like this: java -cp "some.jar;some2.jar" -Dsome.prop.dir=C:\somedir com.software.MainClass Now the issue here is the -Dsome.prop.dir=C:\...
3
votes
1answer
203 views

Query registry value that contains slashes

I am trying to grab the value of the registry key in serialcomm using this command: REG QUERY HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM which gives me: HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\...
0
votes
1answer
223 views

Proper escaping of Characters for Shell execution from ASP/VBScript

I am executing a curl call from ASP with the WScript.Shell Object. Set objCmd = objWShell.Exec("cmd.exe /c echo "&dataString&" | /path/to/curl --cacert '/path/to/cert/cacert.pem' -X POST"&...
1
vote
1answer
44 views

Write windows alt characters in cmd

I want to write a non-space wrap (it's not a full space, just a tiny space alike character) ALT + 0157. The problem is in windows its ok I can rename a file and add that character to it but in cmd, it ...
0
votes
1answer
31 views

Variable printed the expected value but actually its value is different

The following syntax used in order to capture the word between <Name> in .xml file. I also use xargs to remove any spaces. $> var=` find /tmp -name '*.xml' -exec sed -n 's/<Name>\([^&...
0
votes
0answers
1k views

How to escape password in plink sudo command?

When trying to login with plink to a server I don't know how to pass the sudo password in the command correctly. I use something like this: plink -ssh -t <user>@<server> -pw <password&...
0
votes
1answer
664 views

Backslash escape for single quote in sed produces an error

The intention is to insert right after the HEAD Google tag code in a legacy HTML website. #!/bin/bash find . -type f -iname "*.php" -or -iname "*.htm" -or -iname "*.html" | while read i; do echo ...
0
votes
1answer
266 views

Rewrite a call to su-exec with su or similar?

In this bash script under Linux Alpine they have (line 8): exec su-exec "$ZOO_USER" "$0" "$@" As far as I know, su-exec is however an Apache httpd dependecy - can I avoid it installing it under ...
0
votes
1answer
328 views

Watch + pipe + multiple arguments

I have a command diff -y <(xxd FILE) <(xxd FILE_) | colordiff and i want to put it into watch routine. Something like that: watch -n 0,1 'diff -y <(xxd FILE) <(xxd FILE_)' But i have an ...
2
votes
1answer
173 views

Shell sometimes fails to output ESC ^[ character before escape sequence

Occasionally, when pressing an arrow key (usually up) inside of a shell, the terminal or shell fails to output an ESC character before the escape sequence, so if I press the up arrow to try and see ...
1
vote
0answers
50 views

Configure keyboard codes on the client-side to move PuTTY cursor between words

Related to StackOverflow Bash CTRL to move cursor between words/strings. While that thread provided good answers on the server-side, I'm looking for ways to control this on the client-side. I have ...
17
votes
1answer
3k views

Why does `echo -e “\\\SOME_TEXT”` show only one backslash?

Could some one explain what is happening behind the scenes in character escaping in Linux shell? I tried the following and googled a lot, without any success in understanding what (and how) is going ...
0
votes
1answer
43 views

Finding directories which files explicitly contain escape signs like ] , - Space all together

I have several video files, which contain escape characters like [ in combination with [1920x1080]. When I execute: find /run/media/user/usbdisk -type f -iname [HD, 1920x1080] - Wild Wild West.mp4 -...
1
vote
1answer
79 views

How does one italicize code with backslashes in these forums?

I looked through some of the formatting posts on this site but didn't find an answer (or in my case one that worked or made sense not understanding those posters' contexts). I even did a separate ...
0
votes
0answers
623 views

Escaping “new line” character in SRT file

I'm trying to display "\n" in an .SRT file, but VLC automatically interprets it as a carriage return, though I want to display it in a raw way. I've tried combinations like "\\n" or adding quotes, but ...
6
votes
1answer
3k views

How to escape “$@” in a makefile?

test: @echo "#!/bin/bash\njava -classpath \"$(CLASSPATH)\" com.atm.ATM \"$@\"" > test @chmod a+x test I am trying to escape the "$@" so that it literally appears in the "test" script as "$@...
1
vote
1answer
404 views

Powershell redirect to variable value containing colon

Is there a way to use a variable whose value contains the colon character as a filename string in a command-line redirect? Powershell always treats the colon as a drive separator, regardless of escape ...
1
vote
2answers
426 views

Ctrl-enter for fish shell

I had tried to create some accept completion and execute right away combination in fish on pressing Ctrl+Enter. function fish_user_key_bindings bind \c\n accept-autosuggestion execute end ...
3
votes
1answer
237 views

Script SSH Interactive Console that needs escaped chars

I would like to modify my existing SSH connection via a shell script. So if I run an existing script remotely I would like it to open a new port to be tunnelled. Interactively I can do this via: ...
4
votes
2answers
4k views

Escaping “=” (equal sign) in for /f

I'm trying to run the following command in a "FOR /F" in Windows' shell... wmic process where ParentProcessId=%%PID%% get ProcessId The = between ParentProcessId and %PID% keeps gettings replace by ...
2
votes
1answer
1k views

How do I find directories with a question mark in the name? Escaping not working?

I am try to find directories like services-client?.git using the command find . -name *\?.git but get all directories ending in .git What I'm doing is downloading a file from amazon s3 and in ...
-1
votes
1answer
2k views

Escaping ampersand (&) in Windows batch script used to map/connect network drives

Using a simple batch file to connect to network drives on Windows start-up but one of the folder names contains an ampersand and I cannot for the life of me, figure out how to escape it. Here is the ...
1
vote
1answer
1k views

How do I escape a dot / period in bash string match

This is my first post, and I am really appreciating all the answers which helped me so far on that website, I hope this is not a redundant post, but I couldn't find something similar here. I try to ...
0
votes
1answer
32 views

For window 8.1 in my laptop keyboard constantly pressing the ESC? [duplicate]

For window 8.1 in my laptop keyboard constantly pressing the ESC? At time of writing or even in playing games. Even now I can't type, repeatedly ESC is being pressed automatically. I have tried ...
0
votes
1answer
737 views

Windows cmd: escape commands to start cmd from batch file, executing commands that add to PATH

I would like to that a cmd command prompt, which maps a network directory to a local path, and then adds that local path to the (local) PATH variable. I have prepared this kind of .bat script, which ...
1
vote
0answers
73 views

GNU-Screen super-key as escape

The super-key (windows key, et al) isn't representable using ascii or terminal escape sequences, so I doubt a tty-oriented utility like screen would support it, but does it? Can I use the super-key ...
3
votes
2answers
224 views

Treat part of a Regex expression as non-special characters

Let's say I've got a regex expression utilizing some of the special chars, but also a portion with 'normal' text that just happens to have some symbols in. Let's also say I'm too lazy to start ...
1
vote
1answer
514 views

Escaping asterisk * in Bash on Windows

The following command works in GNU Bash on FreeBSD but not in Git Bash on Windows: curl -X PUT https://example.com/_config/cors/origins -d '"*"' The intended result is to send a PUT request to https:...
1
vote
2answers
32 views

How do I output this line to a remote file?

I'm using a bash shell and trying to figure out the right way to write the following: ssh mysuer@remotehost 'echo "update user set url = \'localhost\' where url = \'mydomain.com\';" >> /tmp/db....
2
votes
2answers
769 views

tmux printing u'0x001b' and “]112” randomly

So I've lived with this problem for several weeks now, hoping that if I just let it happen enough, I would figure out the underlying trigger. No luck. tmux in bash in gnome-terminal in XMonad on ...
0
votes
2answers
561 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 ...
11
votes
1answer
14k 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 "...
1
vote
1answer
411 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, ...
0
votes
1answer
325 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 ...
4
votes
2answers
9k 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 Foo="/media/...
3
votes
3answers
469 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
1answer
6k 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 ...
3
votes
2answers
1k 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
6k 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 ...
9
votes
1answer
9k 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 -sh chmod:...
3
votes
2answers
1k 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
1k 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
3k 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 ...
16
votes
4answers
26k views

How do you escape apostrophe in single quoted string in bash?

I don't understand how bash evaluates escaping of apostrophe characters in single quoted strings. Here is an example: $ echo ''\''Hello World'\''' 'Hello World' # works $ echo '\'Hello World\'' &...
7
votes
1answer
8k 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 ...
9
votes
1answer
10k 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
711 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
552 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" "A ...
1
vote
2answers
2k 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 ...