Getting 'gnomesu' to execute multiple commands in a string.

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:


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)

Thanks in advance.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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/

iQIcBAEBAgAGBQJLFqdLAAoJEF+XTK08PnB5h1YP/itv4Oz+27JNqnVPhHHF+2fn
rXb244iHYa0/dM4c5hb8SlrD+AH9tBFRXgoIpZKClS0kOBQJBAQ0dQeS9tEdSi/x
J+QqTgPeZ6A7YkQJ3MAqmtLkg10wJR+HNMcFg+3equduIFuAxVKW3ayUfTKozslR
P27SGtNungbCgO0vB6f9R7aXjyXVVPAdJebBb6UjFez/7Yc0y1SPBB/ftzAKnYZT
QdnXVMcCmXzB4V61SHQ++DySOHooI8RJy6DvQ9FdGyTu/32ThgWd0SbjdiVyyluN
6NVlFgflzniU4V5XHiLsz6ZUNuobFw/6PFO+1nXQDRJ6lNi6igoGXSrUM526MT2I
Z8hPf9EVH9oRWny1/uMpSMZoy9k2XwOcfKPiQ4q3Sk66OobuuxGhKqT0Uj+eJOSx
259xk6WfDP/33wP0u1pIt9iWDDCo69OBpleReyyv388a0f89QzwDLeSNTnmnr2ev
FuTB4XbvnYMAygsPbH03HbzZT3+5kNGc79+85//dJ0d0AqtPJENLSN52DzvmtuUD
EwhPKoPaejeT4j80iU1bg1a3AY9D0+D2OM/7aKjD0wxZt4assXcgovQG0casP7Fe
7r2VU7R4Z3B4LlW+Rt8Bhf6sPq3s3y/+6IrGMzHbrMBYwBMpYwI5C1Y05IoMf/6S
wD9QI44/YfFqNmpkbocX
=HBvG
-----END PGP SIGNATURE-----

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:

su -c 'echo foo && echo bar'
Password:
foo
bar