I am trying to run a command in shell script which demands its argument to be passed in below format which includes double quotes with string.
command "string"
This string is stored in variable var1.
I tried below methods but, not able to achieve the requirement. Can someone please suggest the way to achieve it. I am using bash shell.
command $var1is interpreted ascommand string`command "$var1"interpreted ascommand stringcommand \"$var1\"interpreted ascommand '"string"'command '"'$var1'"'is interpreted as:command '"string"'
set -xtrace output says..." then know that the trace output of the shell is only for debugging and that it is annotated for visual inspection (only). The output fromset -xtraces is not generally suitable for input to the shell.command "string", the double-quotes are syntactic; they change howstringis parsed by the shell, but are not actually passed to the command (and cannot be required by the command).