I basically need to load, save and reload multiple times and in different forms a variable that contains arguments for a program.
The problem is that this variable can't be treated as a usual variable because it contains the "-" sign in the start. And print it or load it to be possible to see what it contains makes things hard due to the constant need of a \\
at the start before it can be used or not.
A trick was always saved it with the \\
, but before reading it, I echo $it
then read the last output as a variable for the use case.
This is strongly impractical, so I need a way to save the contents of a variable in a manner that will never interfere with the code that executes it.
The below variable is used by yad
a default for gdb, but it can be for any other program.
For example, a quick test to know if a variable like that can be used in my context is trough printf
WITHOUT the need of any printf parameter. This is because:
gdbParameters="-ex 'set pagination off' -ex 'set environment G_MESSAGES_DEBUG = all'"
printf $gdbParameters
returns:
printf: usage: printf [-v var] format [arguments]
Thank you all.
printf
. – Cyrus Jun 20 '20 at 17:13