The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [quoting]

Strings are typically delimited by quotes, which raises the problem of dealing with strings that include quotes.

20 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
1answer
50 views

zsh fail to keep unquoted `$*` and `$@` equal

All shells tested do the same for the (quoted) pair "$*" and "$@" with this code: c='set a b @ c; IFS=:,@ ; a=$(printf "<%s> " "$*"); b=$(printf "<%s> " "$@"); printf "%-20s and %-20s\n" "...
2
votes
0answers
52 views

awking for command options from man page

I am trying to auto-generate tab-completions for different commands. I am piping man pages for different commands into awk, then searching for command line options (eg. -shortopt --long-option) ...
2
votes
1answer
43 views

Generating quoted command arguments

I'm working with a HTTP API that demands a very particular set of signed headers + JSON body. And I really want to cURL it for debugging and sanity in general. So, I've written a small script that, ...
2
votes
0answers
143 views

How to explicitly set the tabname of a new gnome-terminal?

I want to explicity rename a tab in gnome-terminal on startup of the tab. I don't want to use gnome-terminal --title flag as that gets reset by my systems bashrc file after whatever else is supposed ...
2
votes
0answers
241 views

Passing external parameter to .exe on Windows using winexe from Linux

I am trying to execute a .exe on Windows from Linux using winexe. This exe requires an external parameter (string) to be fed alongwith. With the following command I have succeeded in initialising the ....
1
vote
0answers
681 views

Hmac with openssl's command line tool with a key that might contain null bytes

Let's say I want to do an SHA256HMAC digest of a file with the openssl command line utility: openssl dgst -sha256 -hmac "$(cat $KEY_FILE)" -hex "$TARGET_FILE" How can I protect this command against ...
1
vote
0answers
151 views

Tab character in exiftool

I need to insert tab character on place of _ between day and hour. exiftool -T -r -filename -CreateDate -d "%Y%"."%m%"."%d_%H%"."%M%"."%S" /Users/***/***/testmapa/mapa2/ > /Users/***/***/testmapa/...
1
vote
1answer
382 views

Escaping bash variables before storing them in an apache hive database

I'm running a script file sqoop_import_ATM.sh and would like to store the logs in a SQL database. First thing I did was to direct the logs into my own variable: OUTPUT="$(/home/me/...
1
vote
0answers
147 views

How to make tcsh not insert whitespace in a command that spans multiple lines

Bash does not seem to insert whitespace but tcsh does. Tcsh bash-3.2.25$ tcsh -c 'echo $tcsh; echo A\ > B' 6.14.00 A B Bash bash-3.2.25$ bash -c 'echo A\ > B' AB How can I ask tcsh to not insert ...
0
votes
0answers
22 views

CSV fields max length error and setting quoting=csv.QUOTE_NONE

After running csvcut on a comma-delimited .csv file (downloadable here): [root@server files]# csvcut -c title,mpn,overview,techspecs2,image_carousel_elargesrc syn_multi-image.csv > syn_scraped_cut....
0
votes
1answer
28 views

add a line to file that contains quotes and variable using bash

I want to add this line to /etc/grub.d/00_header set superusers="ubuntu" where ubuntu is the result of $USER. I've tried this: sudo bash -c 'echo "set superusers='"${USER}"'" >> /etc/grub.d/...
0
votes
0answers
28 views

Quoting of SQL excuted via psql via ssh

I want to execute this SQL line: select * from "foo" where name='bar' I call above line "sql_line" in the next statements. Now I want to call this via psql: psql -c sql_line Now I want to call ...
0
votes
1answer
125 views

Bash variable quoting in a function

I've defined a short helper function in a bash script. For legibility, I'd like to replace the boilerplate headers with a variable declared outside the function. I've tried quoting the declaration ...
0
votes
1answer
613 views

How to launch Notepad++ from the Cygwin command line via an alias?

This is what I tried. $ alias n++='(cd `dirname $1`; "/cygdrive/c/Program Files (x86)/Notepad++/notepad++.exe" `basename $1`)' alias n++='(cd `dirname $1`; "/cygdrive/c/Program Files (x86)/Notepad++/...
0
votes
0answers
177 views

swap strings of text inside vim using regex

I am working with a file where I need to swap "string A" and "String B's" locations simultaneously with a regex inside the vim. Here is an example line of code: succ_1st=`grep 'resulted in successful ...
0
votes
2answers
906 views

Exclude the output from ssh and only log the error if found

typeset -f | sshpass -e ssh -o StrictHostKeyChecking=no user@${IPADDRESS} " $(cat); IFERROR=$(checkscript); echo "$IFERROR"" > ${SSHTEMPFILE} 2>&1 This line...I can't exclude the "...
0
votes
1answer
44 views

Loop across url with static tokens with Oauth

I need to write a loop where I need to pass a "token" (which is fixed) and a variable (i) in the url. Is there any way I can achieve that? I wrote the following code but it is not working. If I put ...
0
votes
0answers
220 views

Zsh - Modify File Completion w/ Quotes

I've been using Zsh recently, and when I complete a file name within quotes, the completion adds a space after the completed file name. Interestingly, this does not occur when I complete directory ...
-1
votes
1answer
147 views

Mutiple commands after sudo in one line

I want to execute multiple commands after a sudo command su - appuser -c "cd /apps/bundle/bundle-client/bin ; export BDL_WEB_USER=not_used ; export BDL_WEB_PASSWORD=not_used ; ./bundle -b ${option....
-2
votes
2answers
133 views

why command not working properly when wildcard is detected

segment of code from shell script fname=$(sed 's/(.*//' <<< $p | awk '{ print $NF }') if [[ $fname == *['!'@#\$%^\&*()_+]* ]] then flag1=0 fi where $p is one line from a text ...