2009-01-25 klockan 18:29 skrev Ignacio Butler:
> > Another approach would be to execute a command like this in the VTE widget:
> > sh -c "'YOUR COMMAND LINE GOES HERE'; read;"
> > In this case the spawned shell will wait for the user to hit Enter (or
> > Ctrl-C or Ctrl-D) to exit.
> it worked.
> Thanks
Hi Ignacio,
I'm glad you got things to work.
> Here is the code:
> [snip]
> char *params[] = {"/bin/sh", "-c", "ls -l ~/;read",NULL};
Make sure that you properly escape any strings you include here, in case you
do not hardcode it...
> char *env[] = {"PATH=/usr/bin:/bin:./usr/local/bin:/bin", NULL};
I'm not quite sure this is a good thing to do. Not inheriting the standard
environment may cause serious issues, like not being able to find programs
in custom paths, not being able to use the X display, or not being able to
use the DBus session bus, among many other things.
— Wouter
Attachment:
signature.asc
Description: Digital signature