New answers tagged

1 vote

Escape a variable for use as content of another script

If you don't want to maintain your own function, you can use shell-quote: $> shell-quote "single'quote" 'double"quote' 'single'\''quote' 'double"quote' shell-quote lets you ...
Eric M.'s user avatar
  • 181
1 vote
Accepted

How do I correctly define and interpolate this variable into my find command?

This is because—since you are quoting the variable, as you should—it is passed aa single string to find. You can see this with set -x: $ all_exts=" -iname \"*.webm\" -o -iname \"*....
terdon's user avatar
  • 239k
3 votes

defining variables inside function

FILE_CORE_NAME="$(/usr/bin/env basename $(/usr/bin/env awk -F "." '{print $1}' <<< "${FILE_TO_PROCESS}"))"; local FILE_CORE_NAME; Even when reformatted on ...
Stéphane Chazelas's user avatar
2 votes

defining variables inside function

local name=value creates a local variable and set it to value. In your case there is no value so you create a local variable which is empty and the local variable hides the non-local variable with the ...
Paul Pazderski's user avatar

Top 50 recent answers are included