Questions tagged [escaping]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
597 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 ...
jojman's user avatar
  • 473
1 vote
1 answer
323 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 ...
edddd's user avatar
  • 189
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 $...
sonofevil's user avatar
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&...
Anonymous's user avatar
0 votes
0 answers
354 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 ...
Sam's user avatar
  • 143
0 votes
1 answer
3k 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='...
Chris's user avatar
  • 3
0 votes
1 answer
694 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" ...
Daveh0's user avatar
  • 133
6 votes
1 answer
3k 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/...
Kamil Maciorowski's user avatar
2 votes
2 answers
476 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:///...
Nils Lindemann's user avatar
0 votes
0 answers
89 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" ...
Nick's user avatar
  • 51
1 vote
1 answer
393 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|...
Adamarla's user avatar
  • 113
0 votes
1 answer
603 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"&...
Mumpitz's user avatar
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 ...
Mohammed Noureldin's user avatar
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 "$@...
xomm's user avatar
  • 321
0 votes
2 answers
146 views

Unescaped commandline content in fish shell

Is there a way to get the unescaped content of command line in fish? I mean if command line is like ... $ ls 'foo' "bar" ... the desired output would be ls 'foo' "bar". The commandline fish command ...
blackwing's user avatar
  • 611
3 votes
1 answer
2k views

unexpected EOF while looking for matching `)'

I get this error bash on my virtual hosting, in cron tasks. My command is following: /usr/bin/mysqldump --user=USERNAME --password="C\(mRA0_ifmv\(" DATABASE > ROOTFOLDER/backup/$(date +%F).sql &...
wapmorgan's user avatar
1 vote
1 answer
553 views

SublimeText3 double-backslash in snippet

I'm using SublimeText3 with LaTeXTools for my LaTeX work and want it to insert a double-backslash+newline when I hit ctrl+enter. Like this: asdf\\ foobar I tried inserting the following into "...
beesteak's user avatar
  • 115
0 votes
2 answers
2k views

Bash script that calls a program with some asterisks in arguments

I’ve spent last hour or so trying to write a pretty simple bash script and I never felt so dumb. So I have a list of strings (which are package selector specifications for a package manager, if that ...
kirelagin's user avatar
  • 2,882
78 votes
3 answers
53k views

Escape Skype Messages to Use Special Character Combinations

In a technical environment it's more than common to copy/paste configuration files, URLs, code samples and such in order to inform the other chat participant about something. In that case all kinds of ...
sjngm's user avatar
  • 2,111
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 "...
DASKAjA's user avatar
  • 822
1 vote
2 answers
3k views

How to use a space in date format section of annotate-output?

I try to use annotate-output (part of devscripts package), to prefix outputs of a script with date and some extra info. First parameter can be a format string passed to date. I want to include a space ...
Vajk Hermecz's user avatar
8 votes
2 answers
9k views

How to transmit locally entered modifier keys or shortcuts to the remote desktop via VNC? Mask or escape them somehow?

I am connected to a xmonad desktop but am only able to use the first workspace. How can I change to other workspaces? Furthermore: If the last terminal is closed, I can’t do anything. How can I open ...
erik's user avatar
  • 1,948
1 vote
0 answers
1k views

Using net user with a system account with a backslash

Entering: net user "IIS APPPOOL\DefaultAppPool" Results in: The syntax of this command is: NET USER [username [password | *] [options]] [/DOMAIN] username {password | *} /ADD [options] [/...
52d6c6af's user avatar
  • 4,160
4 votes
1 answer
2k views

grep fails in upstart script

I have an upstart configuration for a service which needs to check the existance of a process on it's startup. This sounds fairly easy but I'm already trying for 3 hours to get this thing solved and I'...
Thorsten Schöning's user avatar
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 ...
Tyilo's user avatar
  • 2,737
3 votes
1 answer
3k views

why is it true that three backslashes are needed on windows for sed replace

Refering to this question: Why is an extra \needed in cmd.exe to work with sed (MinGW msys-1.0) when \ is not a special character according to cmd /? (see last paragraph or here)? The following ...
panny's user avatar
  • 665
2 votes
1 answer
2k views

Echo string in tcsh with special characters escaped

Is it possible to echo out a string in tcsh such that it is fully escaped, as tcsh would understand? In the same way as printf %q works in bash: % # Create a variable containing a tab character % ...
spookypeanut's user avatar
1 vote
1 answer
80 views

Escaping a directory in a $PATH-like list

I'm developing a wrapper for LibGit2, the Git library. And I come out with a problem: Many GIT functions accept path lists, that is, a string composed of a series of paths separated by a token, that ...
Alba Mendez's user avatar
3 votes
2 answers
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 ...
nvja's user avatar
  • 175
1 vote
2 answers
368 views

bash "pass through" script for android build, space issue

I have an android build i need to customize, the question is ehre and not in stackoverflow because my issue wis with bash. I wrote a script: #!/bin/bash -xv params=$@ if [ "$#" -ge "2" ]; then ...
codeScriber's user avatar
3 votes
2 answers
3k views

Transferring environment variable through SSH / quoting in bash/sh/csh/tcsh

I want to transfer an environment variable over SSH. The "correct" way is using SendEnv/~/.ssh/environment, but that requires the server to support AcceptEnv or PermitUserEnvironment, which it does ...
Ole Tange's user avatar
  • 4,779
0 votes
1 answer
2k views

cmd.exe quoted string expansion?

Bash has the feature of quoted string expansion, which will allow you to send special characters like so #!/bin/sh rtmpdump \ -r rtmp://freeview.fms.visionip.tv/live \ -y tvnetwork-hellenictv-...
Zombo's user avatar
  • 1
0 votes
1 answer
924 views

How to quote a command between backticks when shell scripting

The command executed in the following script works: #!/bin/bash -xv REM_DIR="/home/jan/rem-dir" SSHOPTS="-C -c arcfour256 -o "\""ServerAliveInterval 15"\" SSHUSER="[email protected]" CMD="ssh $SSHOPTS ...
Jan's user avatar
  • 11
13 votes
6 answers
23k views

where is the '^]' character on an azerty keyboard?

I am currently using telnet and i need to do an escape character (SMTP), where is this character on an azerty keyboard? (linux ubuntu).
Sylario's user avatar
  • 925
1 vote
2 answers
3k views

How to escape & sign in excel footer?

I need to have an excel footer that contains the string "&T". My problem is that when I attempt to do this excel automatically changes it to be "&[Time]". Is there anyway to escape the & ...
Kellenjb's user avatar
  • 1,215
1 vote
2 answers
498 views

Run Program Escape Sequence Putty

Run windows calculator in windows from the Unix command prompt environment! >echo \\calc How would I accomplish this same task in putty?
anon5456919's user avatar
0 votes
1 answer
1k views

cat file that contains escaped characters to netcat

I'm trying to test a webserver with some HTTP request written in a file. GET / HTTP/1.1\r\n\r\n Right now I'm feeding that file to netcat like this: cat files | nc localhost 80 However, the \r\n ...
Wei Shi's user avatar
  • 795
2 votes
3 answers
977 views

OS X: How to get the current network location inside a bash function?

I need to use the current network location inside a bash script conditional. I've tried using the scselect command, which outputs an asterisk next to the current location: ~/ scselect Defined sets ...
GJ.'s user avatar
  • 9,843