Shell

Hershel Fisch hershf at rgllc.us
Wed Oct 4 16:01:58 EDT 2006


On 10/4/06 6:51 AM, "Sarah Reichelt" <sarah.reichelt at gmail.com> wrote:
Thanks,
 this is what I put into the message box

put "#!/bin/sh" & cr into tScript put "pw=" & quote & "vehachhkl" & quote &
cr after tScript
put "echo $pw | sudo -S /usr/local/bin/postmaster -D /usr/local/pgsql/data -
i" & cr after tScript
put shell(tScript)

This is the result for the above script
Password:
"root" execution of the PostgreSQL server is not permitted.
The server must be started under an unprivileged user ID to prevent
possible system security compromise.  See the documentation for
more information on how to properly start the server.

--put "#!/bin/sh" & cr into tScript
put "pw=" & quote & "vehachhkl" & quote & cr after tScript
put "echo $pw | sudo -S /usr/local/bin/postmaster -D /usr/local/pgsql/data -
i" & cr after tScript
put shell(tScript)

And this is the result for this script, I'm wondering.
1
But it doesn't open "postgres"
Thanks again.
Hershel


> On 10/4/06, Hershel Fisch <hershf at rgllc.us> wrote:
>> Hi, I'd greatly appreciate if some one can help me out on this one.
>> How do I write this command with the shell function, I would write it in
>> terminal as follows
>> 
>> Su -  myUsr
>> Password:
>> And another command.
>> 
>> Now the question is that every line above is a different entry
>> If I put
>> Put shell("su - myUsr") in the message box this is the result
>> "Password's: Sorry"
>> 
>> And also if I understand correctly every command with the shell function is
>> a different terminal and does not correspond to the previous shell reply, is
>> that true? If so how do I write that every command should correspond to the
>> previously respond?
> 
> 
> You have to construct the shell commands as a single string and do it
> all at once. Here's an example of how to use sudo to set the system
> clock, but just put whatever you want after the "-S".
> 
> put "#!/bin/sh" & cr into tScript
> put "pw=" & quote & tPass & quote & cr after tScript
> put "echo $pw | sudo -S date " & tDate & tTime & cr after tScript
> -- build the command lines, the command you need to run goes after the -S
> put shell(tScript) into tCheck  -- do the command & get the result
> 
> You have to quote your admin password, but you can ask for that when
> running the script, or store it in a custom property.
> 
> HTH,
> Sarah
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the Use-livecode mailing list