Questions tagged [escaping]
The escaping tag has no usage guidance.
26
questions
0
votes
0
answers
426
views
Bash Script - How to escape JWT in curl correctly
Im trying to just execute some curl commands against an API from within a bash script. I wrote it on Mac OS and the thing ran without issues. I started executing it on linux and found some strange ...
0
votes
1
answer
920
views
Run commands that run in a shell as a script
Running the following commands in a shell runs without issues:
ssh user@machine systemctl status my-service.service
ssh user@machine sudo systemctl stop my-service.service
scp -r ./my-service/* user@...
0
votes
1
answer
7k
views
Ubuntu Server Cron Jobs not running [duplicate]
iam about to blow up: i cant figure out why my jobs in the crontab -e file of any user are not running. None of them do so the "last cron job is not running" problem is not aplicable. Also i checked ...
2
votes
1
answer
3k
views
Passing inner quotes from EnvironmentFile variable to ExecStart
In the EnvironmentFile I have:
EBUSD_OPTS="--scanconfig -d /dev/ttyEBUS -c /etc/ebusd --log=\"all notice\" --log=\"update error\""
In the .service file:
EnvironmentFile=-/etc/default/ebusd
...
1
vote
1
answer
345
views
How to escape single quotes in rsync out-format parameter under bash?
I'm using bash version 3.0.9 under Centos 7, and I just can't seem to find a combination of escaping that will let me pass single quotes to the out-format parameter. I've tried every combination I ...
5
votes
1
answer
4k
views
In a nginx configuration file, how to define a fastcgi_param that contains the "$" sign?
I'm trying to define a few environment variables for a PHP application but one of these variables contains the "$" sign. When I test the configuration file with nginx -t, I get an error message ...
1
vote
1
answer
926
views
How to make bash treat variables as strings using process substitution
I have the statement:
A=$(echo "echo a") && bash -c "awk -v var=\"$A\" 'BEGIN {printf \"%20s\", var}'"
Which outputs:
echo az
And I can't make this one-liner work:
A=$(echo "...
9
votes
3
answers
25k
views
How to escape spaces in systemd unit files?
My unit file looks like this (already attempted to escape spaces as \x20 like the docs say):
[Unit]
Description=My Service
[Service]
Type=simple
WorkingDirectory=/home/cobra/my\x20service/
ExecStart=...
0
votes
2
answers
1k
views
How to escape pipeline char in Windows shell?
I need to specify a regular expression that includes | character to findstr command:
processtext.exe | findstr /R "Hello|Bye"
How do I escape it? \| does not work. Quotes fix issue with pipelining ...
2
votes
1
answer
838
views
bash: Something like quotemeta() for pattern characters?
Background
I am aware of bash's various string manipulation capabilities.
Also, I know I can escape special pattern characters with a backslash \.
For instance:
# x is a literal string 'foo*bar'
x=...
0
votes
1
answer
4k
views
Deal with dashes and spaces in T-SQL String functions
I am searching for the occurrence of a string in a field on a table. The search statement is done through dynamic sql with my statement template looking like this.
SET @sSQL = 'UPDATE #...
2
votes
2
answers
28k
views
Properly escaping a path with spaces in CMD shell
I have the following path:
"d:\workspace\Server trunk - CI\make\make & publish.bat"
However, when I try to execute this from a cmd shell, I get the error:
'd:\workspace\Server' is not ...
3
votes
4
answers
8k
views
How to escape "/" in a sed command in Puppet script?
In a config file, I'm trying to replace PREFIX=/jenkins with, say, PREFIX=/foobar.
On the (bash) command line, this works fine:
sed -i.bak s/PREFIX=\\/jenkins/PREFIX=\\/foobar/g /etc/default/jenkins
...
1
vote
1
answer
224
views
SSH hangs every time an escape character is transmitted
I've been asked to continue installation of a freshly installed Debian system. I can log in there through SSH with no problems. But the connection hangs every time the remote shell sends an escape ...
0
votes
3
answers
15k
views
sed replace text - escape characters
I have a mysqldump file in which I want to replace the following text <a href="/tag/ with <a href="http://www.mydomain.com/tag/ but can't find a way to correctly escape all special characters.
...
3
votes
1
answer
3k
views
Executing bash code interactively using -c flag
I am trying to run a shell fragment with the bash interpreter. Using the -c flag allows me to provide the commands directly into command line without writing to a file. This is required for my usage.
...
13
votes
1
answer
7k
views
Apache mod_rewrite double encodes query string on redirect
We've encountered a strange issue (a bug, perhaps?) with Apache mod_rewrite's behavior when passing through query strings.
To reproduce, we've set up a clean Ubuntu (oneiric) install with the default ...
2
votes
1
answer
3k
views
Escape sequence for the escape key
On an SSH terminal, there is a command that takes over the terminal window, and it says I can press escape to end it.
My SSH terminal does not handle the escape key. What is the escape sequence (Ctrl+...
29
votes
3
answers
43k
views
How does one escape the " ` " (accent grave/backtick) in a path?
I tend to prefix oft-used files and folders with the "accent grave" character (non-shift tilde, the back-tick, or plain-old accent, whathaveyou..), as it is easy to get at, and let's me sort things ...
5
votes
2
answers
6k
views
How to escape or remove double quotes in rsyslog template
I want rsyslog to write log messages in JSON format, which requires to use double-quotes (") around strings.
Problem is that values sometime include double-quotes themselves, and those need to be ...
2
votes
2
answers
7k
views
Printing a '$' (dollar sign) to a file
I want to echo/printf a dollar sign into a file - but echo $ > myfile or such does not work (not surprising).
I tried escaping it like echo \$ > myfile but it is also not working.
What is the ...
4
votes
0
answers
1k
views
DSGET escapes hash signs (#) in outputted Distinguished Names (DN)s but expects unescaped hash signs for input
Lets say I want to do the very simple query in AD
dsquery user -name "John Smith" | dsget user -memberof -expand
This will output the DNs of the AD groups that this user belongs to. I can make it ...
0
votes
1
answer
130
views
Do modern mail servers still escape lines they think are headers?
For many years I have made it my practice to set up my e-mail clients so that when I forward e-mails I forward them as attachments rather than forwarding them "inline".
I did this because, in the ...
9
votes
4
answers
6k
views
Searching for literal "> \" using ack-grep
I am looking for lines that literally have a greater than character (a ">") followed by a space followed by a backslash character (a "\")
i.e., a line with this: > \
I thought escaping would allow ...
4
votes
3
answers
264
views
run local MySQL instance for fast mysql_real_escape_string calls
Currently all MySQL data/API calls are handled by a remote DB cluster (i.e. network latency is a factor in total script execution time).
To reduce execution time in this context, would it be sensible ...
0
votes
2
answers
4k
views
batch for loop with bracket in the command
I have a batch file with the following code:
for /f "tokens=*" %%a in ('dir /b /a-d') do (
echo Processing %%a >>%LOG%
dtsrun /S(local) /NNotesLoad /A"FilePath:8="%NOTESDIR%\%%a" /AClientID=%...