I’m trying to get ‘gnomesu’ to take a string of commands and execute them one by one, as you’d expect. So far, it only wants to execute the first one and use the rest of the string as an argument to that command. So, doing something like this:
gnomesu --command "echo foo; echo bar"
which you’d think would work, will print this in the console:
foo; echo bar
which is what I do not want.
I can remove the quotes and it will only execute ‘echo’ (without foo) and then execute ‘foo; echo bar’ separately. I’ve tried passing the string in '()'s, '{}'s, single-quotes, graves ‘`’, without the separating semi-colons and all combinations possible with the above syntax; yet ‘gnomesu’ refuses to execute each command separately.
So, does anybody have any ideas? Is this just a limitation of ‘gnomesu’ or would sudo be a better choice? (The script uses zenity for all user interactions thus far, and I need ‘gnomesu’ for repository modification; another reason for ‘gnomesu’ is the fact that it lets the user know what’s about to happen with the password dialog displaying the command)
Probably escaping characters for you so you do not do something silly on
accident, but that’s just a guess. Perhaps create a script with multiple
commands and then call that script with just the one command.
Good luck.
i-ghost wrote:
> Hi,
>
> I’m trying to get ‘gnomesu’ to take a string of commands and execute
> them one by one, as you’d expect. So far, it only wants to execute the
> first one and use the rest of the string as an argument to that command.
> So, doing something like this:
>
>
> Code:
> --------------------
>
> gnomesu --command “echo foo; echo bar”
>
> --------------------
>
>
> which you’d think would work, will print this in the console:
>
>
> Code:
> --------------------
>
> foo; echo bar
>
> --------------------
>
>
> which is what I do not want.
>
> I can remove the quotes and it will only execute ‘echo’ (without foo)
> and then execute ‘foo; echo bar’ separately. I’ve tried passing the
> string in '()'s, '{}'s, single-quotes, graves ‘`’, without the
> separating semi-colons and all combinations possible with the above
> syntax; yet ‘gnomesu’ refuses to execute each command separately.
>
> So, does anybody have any ideas? Is this just a limitation of ‘gnomesu’
> or would sudo be a better choice? (The script uses zenity for all user
> interactions thus far, and I need ‘gnomesu’ for repository modification;
> another reason for ‘gnomesu’ is the fact that it lets the user know
> what’s about to happen with the password dialog displaying the command)
>
> Thanks in advance.
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
I have never used gnomesu, but I guess that it lets you execute just one command for security reasons. Trying the same with su behaves completely different: