On 7/24/02 1:12 PM, "Will Hartung" <[EMAIL PROTECTED]> wrote:
> From: "Roman Mikhailov" <[EMAIL PROTECTED]>
> Sent: Wednesday, July 24, 2002 11:34 AM
> Subject: Unix command from jsp does not work
>
>
>> I'm trying to execute a unix command from within the jsp page, smth like
>>
>> Process p = Runtime.getRuntime().exec(new String[]{"/bin/sh","-c","ls -l >
>> dat.foo"});
>>
>> .. And it doesn't work, I mean nothing happens , no error messages,
> nothing
>
> Well, if the ls -l happens to not find the file foo.dat, then it's proper
> result would be to, essentially, "do nothing". So, perhaps it actually is
> working, and the file you're running 'ls' on isn't there?
>
> P.S. just an FYI, but you do realize that the java.io.File object does
> pretty much what 'ls' will do for you, right? Plus, it's portable...
>
> Regards,
>
> Will Hartung
> ([EMAIL PROTECTED])
>
>
>
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
ls -l > foo.dat was just an example
My task is to envoke a perl script from jsp which looks like this:
Process p = Runtime.getRuntime().exec(new String[]{"/bin/sh","-c","echo
[EMAIL PROTECTED] | /root/bin/bulkmakemail"});
For some reason I'm not able to run ANY unix commands from jsp
Can it be because of "user privileges" , do I have to run tomcat as root?
I know it is dangerous
Or is there any other way I can fix this problem?
Thank you
roman
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>