A bash scrip is invoked like this:
$./script 25 "str1 str2"
and it is supposed to launch a terminal, that runs another script that receives both arguments, exactly as they are above (including quotation marks). I've tried this:
lxterminal --command=$"./script2 "$"$@"
but this seems to omit the quotations marks, so the call would end up as ./script2 25 str1 str2
. What is the correct notation to replicate the arguments as they were in the original command line?
str1 str2
as one single string, add single quotes to your first command.$./script 25 "'str1 str2'"
lxterminal --command=./script2 25 'str1 str2'
from a terminal, it works fine, but trying$./script 25 "str1 str2"
(what produces the same command, as shown byecho
), it raises an error, saying thatlxterminal
has been used in a wrong way (Usage: lxterminal [Options...]
, etc.). Besides, this is intended to be typed by non-skilled users, so the double-single quoting will bring trouble.number "string1 string2"
structure ? If that's so, you could refer to them by position. Also, why do you use$
in second script within the--command=
part ?