The real sticky one this when you're using conditionals or something, e.g.

  if [ -x /path/to/something ]; then cd /path/to; something; fi

First of all, you can't do "sudo if [...] ... fi", because "if" isn't a command, it's shell syntax. You either need to do "sudo sh -e '...'" or you do "if [...]; then sudo cd /path/to; sudo something; fi".

Basically, I don't know that there is a good way to do this generally. Maybe cap just needs to expose a simple way to "inject" sudo into commands...

- Jamis

On May 20, 2008, at 2:16 PM, Wes Gamble wrote:

This could be ugly, but when Cap is presented with "sudo x && y", could that actually be executed as "sudo x && sudo y"?

I haven't tested it and have no idea if it would work with regard to both running both commands successfully and returning the correct values for success/failure on the first command for short circuiting purposes.

Wes
-------------- Original message from Jamis Buck <[EMAIL PROTECTED]>: --------------


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to