lc shell and command line

Andre Garzia andre at andregarzia.com
Fri Nov 18 12:26:12 EST 2011


Guys,

As far as I know, you can't ask for the user password and pass it to a
shell call with clever use of pipes. That is not how sudo works, you can't:

 cat password.txt | sudo cd ..

or

  sudo cd .. < password.txt

The only way I found to script sudo calls is by using expect (
http://www.nist.gov/el/msid/expect.cfm ). Expect is a tool to automate
interactive console applications. You can craft an expect script that call
sudo and whatever else you want to do and call that script with shell().

=)



More information about the use-livecode mailing list