Questions tagged [escaping]
The escaping tag has no usage guidance.
39
questions
0
votes
0
answers
84
views
Escaping special characters in password with WinRS
We use WinRS command from various admin scripts to issues commands to remote Windows servers:
winrs /remote:host /username:user /password:pwd command
This is working well except when password pwd ...
1
vote
1
answer
908
views
How to pass bash's $@ over ssh accounting for spaces in arguments?
I want to read logs conveniently from my server. I'm trying to write a script that reads output of journalctl from my server, applying the parameters I pass to the script to journalctl call. I may ...
1
vote
1
answer
420
views
How can I escape single quotes in cmd parameter?
I wanted to display a network profile in cmd using netsh, with netsh wlan show profile name="JohnDoe's iPhone". This WiFi name has an apostrophe in it, as you can see. The command responds ...
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
1
answer
5k
views
Escaping double quotes in .csv
I have a .csv file which has values like
Abc,3/4"×3/4"
Paper,Blue,2"
Abc 45 xyz 3/4""
The issue is when I open it in notepad these values become
"Abc,3/4""×3/4&...
0
votes
0
answers
371
views
Is it required to sanitize parameters of curl (called from a bash script) filled with user inputs?
Is it safe to run curl in a bash script like this:
#!/bin/bash
response=$(curl --data-urlencode "user=$username" --data-urlencode "pass=$password" https://my-api-url)
with ...
0
votes
1
answer
4k
views
sed - replacing string with variable containing?
Please help, I am not getting anywhere despite extensive search in here.
I have a html file, and I want to replace some of the links it it - problem is, some of the links have a ? in it.
original='...
0
votes
1
answer
726
views
trouble with spaces in environment variable in rsync script on MacOS
I have a Bash script that I plan to run for daily backups (my HOME is /Volumes/Norman Data/me):
#!/bin/bash
# Halt the script on any errors.
set -e
# Remote server where
remote_server="example.com"
...
6
votes
1
answer
4k
views
How can I single-quote or escape the whole command line in Bash conveniently?
Introduction
Consider a tool like watch that can take another command (e.g. ls -l) like this:
watch ls -l
# or equivalently
watch 'ls -l'
If the command is more complicated, it's all about quoting/...
2
votes
2
answers
507
views
Display unescaped URLs in the Chrome address bar
I have whitespaces in some local files. Is there a possibility, for example an addon, to change the way the URLs of such files are represented in Chrome’s address bar?
For example instead of
file:///...
0
votes
0
answers
92
views
emacs find file at point double backslashes on windows
My problem is that I want to be able to navigate to directories like:
"..\\A\\B\\a.blah"
Currently, when i use the ffap command, it works for:
"../A/B/a.blah"
"..//A//B//a.blah"
"..\A\B\a.blah"
...
1
vote
1
answer
418
views
Set arbitrary text to windows clipboard
I'm using clip to set text on the clipboard.
To do that, I use echo.
echo Works|clip
The problem is when the text contains special characters, eg. | ".
echo (TRUE|FALSE)|clip
echo " is a Quote Mark|...
0
votes
1
answer
634
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"&...
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 ...
11
votes
1
answer
10k
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 "$@...