Skip to main content

Questions tagged [quoting]

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

23 questions with no upvoted or accepted answers
4 votes
0 answers
293 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 ...
Prodnegel's user avatar
  • 141
3 votes
1 answer
115 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" "...
user avatar
2 votes
0 answers
3k views

How to escape all of the special characters in order to be able to print the string as is?

I'm creating a tcsh script on the fly (with a static language). I have a <add-command-here> section that contains some command. I want to do: echo <add-command-here> In that <add-...
vesii's user avatar
  • 203
2 votes
1 answer
180 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) ...
myc3lium's user avatar
2 votes
0 answers
318 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 ....
KM_Guest_MMP's user avatar
1 vote
2 answers
382 views

How to execute function within double quotes?

I have these function: #execute vim and then exit on err return ve() { vim "$@" || exit } export -f ve #compile c source -> asm source in new tab in xfce terminal casm() { [ -z ${1} ] &&...
Herdsman's user avatar
  • 350
1 vote
0 answers
3k 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 ...
martin's user avatar
  • 113
1 vote
1 answer
202 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/...
ikiK's user avatar
  • 131
1 vote
1 answer
608 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/...
Greg Peckory's user avatar
1 vote
0 answers
216 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 ...
Gowtham's user avatar
  • 2,089
0 votes
0 answers
71 views

Why are my strings being truncated including and after an equals sign?

I was writing a shell script for inserting a string value through a Microsoft sqlcmd variable into a Microsoft SQL server database table and noticed some unexpected behavior. It appeared the trailing ...
Mark's user avatar
  • 101
0 votes
0 answers
28 views

In the nullmailer `remotes` configuration file, how do I quote single quotes in the password?

I'd like to use nullmailer to have my Debian (bullseye and bookworm) systems send system-generated email messages to the appropriate recipient. nullmailer is configured (among others) by the file /etc/...
Binarus's user avatar
  • 3,410
0 votes
2 answers
874 views

How to properly parse a quoted arg-list string in a shell script?

Summary How to convert a single string a "b" 'c d' $'e\nf' into separate arguments, respecting quotes and preserving whitespaces and newlines? Question I'm trying to read and process the ...
Christian's user avatar
  • 101
0 votes
1 answer
241 views

dash: How can I quote the arguments ala "${(q+@)@}" in zsh?

I want to quote the arguments in dash (or sh, or even bash if that's not possible). I can do that with "${(q+@)@}" in zsh, such that reval <sth> ... is the same as just typing in <...
HappyFace's user avatar
  • 1,620
0 votes
1 answer
232 views

Output double quotes and variable

I'm writing a script to automate Let's Encrypt in PowerDNS,(this is a simple bash shell script to be run on debian) Certbot runs and calls the script, feeding to it the variable: $CERTBOT_VALIDATION ...
mike's user avatar
  • 1

15 30 50 per page