Questions tagged [escape-characters]
The escape-characters tag has no usage guidance.
106
questions
1
vote
0
answers
75
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
110
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
54
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 ...
0
votes
2
answers
449
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
29
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
908
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
718
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=&...
0
votes
0
answers
1k
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
365
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
340
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 /...
1
vote
2
answers
681
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
$...
1
vote
1
answer
1k
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
2k
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
386
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. ...
0
votes
1
answer
208
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
1k
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
vote
1
answer
309
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 .
...
-1
votes
1
answer
874
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
6k
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 ...
1
vote
2
answers
1k
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
241
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\...
0
votes
2
answers
2k
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
3k
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
91
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
299
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
159
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 ...
2
votes
4
answers
6k
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
74
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
208
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
3
answers
5k
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 ...
2
votes
1
answer
167
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
1
answer
982
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
1
answer
531
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"&...
2
votes
1
answer
679
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
1
answer
41
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
0
answers
3k
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
1
answer
2k
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 ...
4
votes
1
answer
3k
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 ...
1
vote
1
answer
918
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 ...
3
votes
2
answers
921
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
0
answers
75
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 ...
22
votes
1
answer
16k
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
1
answer
67
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
1
answer
253
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 ...
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 ...
11
votes
1
answer
9k
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
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 ...
1
vote
2
answers
911
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
...
2
votes
1
answer
597
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:
...