Questions tagged [escape-characters]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
47 views

Passing `Set /p _var=/irc:` when used by findstr, the colon does not get processed the same as if I typed `findstr /irc:` Example provided

I have search through the undocumented 'findstr' thread, SS64 findstr-escapes as well as SS64, Escape Characters for how to include the colon in the following way; no luck with either. Example batch ...
1 vote
0 answers
132 views

How to properly escape in windows command shell - even the asterisk?

By following good (though sometimes conflicting) advice such as Quotes, Escape Characters, Delimiters - Windows CMD - SS64.com or Escape character – Wikipedia, section 2.6 Windows_Command_Prompt or ...
0 votes
1 answer
57 views

Complex escape coding in a batch for-loop

Reference is made to https://superuser.com/a/1508668/1884857 In my code I have added Vomit IT's code into a for loop. However, the code stops at the line: ECHO [int]$Calculation.split("%MathType%&...
1 vote
1 answer
5k 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 ...
6 votes
2 answers
11k 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 "[email protected]" However ...
28 votes
4 answers
46k 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\'' &...
0 votes
0 answers
120 views

Auto apply backslash to pasted text in iTerm2, that contains '?' (indicator to the start of query string in URL)

Previously, I could paste a website URL (Ex. https://www.youtube.com/watch?v=VIDEO_ID) after copying from the browser URL section, onto iTerm2 window. It would escape the question mark and equal sign, ...
1 vote
1 answer
2k 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 ...
1 vote
0 answers
306 views

how to escape inside reg.exe windows registry - strange behavior

Everybody say that \ works as an escape inside reg.exe like: The REG command will interpret \ as an escape for the character that immediately follows it. source but I found it not a full correct ...
0 votes
1 answer
1k views

In powershell to treat string as raw sting

I have to go to this C:\Users\user\Documents\code\dart\learning_dart\bin\string_lerning\ directory in Powershell I can use cd C:\\Users\\user\\Documents\\code\\dart\\learning_dart\\bin\\...
3 votes
1 answer
89 views

Windows cli elusive escape

After reading this question I found that while I know how to escape in linux/bash I did not fair so well in windows cmd/batch. Anyone know how to properly escape the windows version of the command ...
1 vote
1 answer
489 views

Unable to delete hidden files starting with "._", containing special characters

The file name is ._03 Überlin.mp3, and it lives in a folder on a Western Digital NAS external drive, being accessed on a Mac: $ ls -al total 128 drwxrwxr-x@ 1 kraftydevil staff 264 Jul 23 03:58 . ...
0 votes
2 answers
2k views

How to escape "&" in Android ADB shell command?

Seeking help with how to escape "&" in ADB command line -- any guidance would be much appreciated! I am attempting to extract .epub book files from an Android tablet running B&N Nook ...
-1 votes
1 answer
30 views

Deleting files that start with " or '

Sort of noob Linux user here. I would like to delete a number of files that are contained in a list. The files may contain spaces in their names. I can create a file that goes something like this: rm -...
6 votes
1 answer
1k views

Echo to clipboard with special characters

I believe I am using the commands correctly, but the clipboard is empty using the following: C:\Windows\System32\cmd.exe /c echo 28376^>1847|clip I believe the problem is the > which I am using,...
0 votes
1 answer
1k views

Escaping quotation marks in a bash script on macOS

I want to turn the following command: $ gdate --date='TZ="America/New_York" 1am' +"%a %F %H:%M %Z" into a script using parameters, such as: #!/usr/bin/env bash gdate --date='TZ=&...
84 votes
3 answers
31k 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 ...
108 votes
8 answers
359k 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: ...
0 votes
0 answers
2k views

How to Escape & (Ampersand) and @ (At Sign) in Batch File when Passing File Name to PowerShell via a For Loop in cmd on Windows 10

We are using a .cmd batch script in cmd on Windows 10 and Windows Server 2016/2019 with a "header" that copies the file to the %Temp% folder location and then requests administrative ...
3 votes
1 answer
401 views

Include an "at" symbol ("@") in a text cell

I'm organizing some stuff in a spreadsheet. None of it should be interpreted as anything other than than text, but it does contain a lot of non-alphanumeric characters. If I include the character @ in ...
-1 votes
1 answer
664 views

Windows 10, cmd start with & in the command path

I'm now using OneDrive for work. This has caused me some problems with a specific command that I have pined. The OneDrive path now contains spaces dashes and an ampersand. C:\Windows\System32\cmd.exe /...
2 votes
2 answers
1k views

How to escape a character in Write-Output with Powershell?

I am searching for $software in a list with -Match "$software". I also want to Write-Output $software to the screen. In the case of Notepad++ I have to escape the second +. I've tried $...
67 votes
5 answers
60k 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 | ...
1 vote
1 answer
2k views

Passing list of file paths in variable as arguments to command

Scenario: kdialog --menu takes a list of strings of the form title element label element label .... Now, the issue with this is that spaces are used as delimiters. Let's say I have a string variable $...
0 votes
2 answers
4k views

sed cannot interpret a literal hyphen

I'm using sed on a command line to edit a file. This works: sed "1,/abc/d" file1.txt > file2.txt It excises everything in file1.txt up to and including the abc. But this doesn't: sed &...
1 vote
1 answer
658 views

Ctrl-V in TTY not escaping Ctrl-C

For the record, this has nothing to do with copying and pasting, which is likely why it's so difficult to find an answer. I am attempting to insert a literal CTRL-C character into a stream from a TTY. ...
25 votes
2 answers
46k 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 "...
242 votes
6 answers
154k 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 ...
0 votes
1 answer
371 views

How can I view the control sequences that my terminal is outputting in text form?

I have a terminal graphical error I need to troubleshoot, and I'm not sure what the right tools for doing this are. I'm imagining my workflow will look something like: turn on terminal recording ...
1 vote
1 answer
2k views

window batch) escaping special characters in 'for' sentence

I symplified my problem here: @echo off for %%a in (& ? !) do echo %%a pause>nul I want it to just print & ? ! but it doesn't work that way and rather takes an error I know that the ...
-1 votes
1 answer
1k views

Escaping parenthesis in PowerShell Invoke-Expression

Below is a one-line script I am writing that is causing problems when I try to add an open-paran within invoke-expression. Within the script, the file map.txt contains 800 lines of 3 digit numbers. ...
1 vote
2 answers
8k views

Escaping a parenthesis in Powershell -Replace parameter not working

I want to rename files from this: Howard -((TV) )RED HEADED LEAGUE.mp4 to this: Howard - (TV) RED HEADED LEAGUE.mp4 Since the -Replace Powershell command uses regex regular expressions, I did this ...
3 votes
2 answers
1k 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
2 answers
2k 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 ...
2 votes
3 answers
6k views

Inserting \r\n into parameter on Windows

I'm using FFmpeg on Windows where I need to insert an \r\n in a parameter itself. ffmpeg … -headers "X-Test: Test\r\nX-Test-2: Test 2\r\n" … While this will work fine under Linux and such, it does ...
1 vote
2 answers
2k views

How to run CMD commands in powershell without escaping special chars?

I am trying to use PowerShell as my default shell, instead of cmd. But some trivial cmd commands are pre-processed by powershell and broken, for example: PS C:\git\myproject> git stash show stash@...
0 votes
1 answer
366 views

How Do I Paste A Path Into Netbeans With Proper Formatting?

every time I past a file's path into Netbeans (for example, C:\programs\test.txt) I always have to add in the escape characters so that Netbeans understand the path. So, I will paste "C:\programs\...
22 votes
1 answer
17k 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
2 answers
4k views

Rename with a "/" in the name

I am trying to change a @ in the name to / for multiple files using cmd's ren command but couldn't as "/" is an identifier. None of the below worked... 1. ren TODAY@WEEK TODAY/WEEK 2. ren TODAY@WEEK "...
0 votes
2 answers
4k views

Sending correct escape sequences in terminal

Issue To scroll a few lines up in WeeChat one is supposed to press <Alt> + <PgUp>. When I press these keys, the program thinks I'm pressing <Alt> + , instead. Debugging In my ...
0 votes
1 answer
180 views

How to compare an escape sequence with a constant string?

I wanted to do a thing conditionally based on the background colour of my terminal, which I found out can be grasped by running printf '\e]11;?\a' In my case the output is stanton@mybox:~$ printf '\...
1 vote
1 answer
2k views

How to escape quotes & (semi)colons in tmux bind-key?

I'd like to do something like this bind-key -T root ' <some-command> bind-key -T root " <some-command> bind-key -T root : <some-command> bind-key -T root ; <some-command> # ...
5 votes
1 answer
402 views

Why does make ignore escape sequence if the output is piped

In a Makefile, I want to print a byte represented as a hexadecimal number and pass it to STDIN of another program. For some reason, it doesn't work: without-pipe: @printf '\x66\x6f\x6f' with-...
0 votes
1 answer
224 views

Are there charsets which doesn't have Space at Code 0x20?

Are there other charsets besides EBCDIC that doesn't have the Code 0x20 for a space? I saw some programs which has the space hardcoded as 32. Should I always use escape sequences for spaces or is ...
3 votes
2 answers
5k 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
4 answers
7k views

Excel adds quotation marks to the end of my formula

Excel automatically corrects my formula, saying "We found a typo in your formula and tried to correct it to:" =CONCAT(CHAR(34),A4,""":""",D4,"""") My original formula only has three quotation marks ...
0 votes
2 answers
92 views

How to find a file path like `\\company\path` while in edit mode in a browser editor like confluence

When editing a page in confluence CTRL-f brings you to a find-and-replace dialogue instead of the find field of your browser. When filling in a file path in the find box of this dialogue, you don't ...
2 votes
1 answer
258 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\]\#\...
4 votes
2 answers
3k 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 doesn't ...
2 votes
1 answer
209 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:\...