For the life of me I can't get a shellscript to run from
execl() properly. It is incredibly odd.
The script "test.sh" is an ordinary shell script with permissions
set to 755 owned by root:root in /usr/local/bin and is in the
path for everyone.
Inside an app I'm working on, I do a fork(), and then try to
execl() the shellscript with:
execl("/bin/sh", "/bin/sh", "-c", "test.sh", NULL);
The above fails all the time period.
If I'm logged in as "mharris", and I do:
execl("/bin/sh", "-c", "test.sh", NULL);
It works, despite the documentation for execl saying the first
two passed args should be the same. If I log in as
"testuser" however, and run the program it does not
work. Doesn't matter which of the above execl()'s I use.
I haven't used exec family of functions in programming much other
than to fire off an executable here and there. This is my first
time wanting to fire off a shell script. I've followed the
manpage and GNU info documentation for exec family of functions
and all to no avail.
Could someone please send me code which is guaranteed to execute
ANY shell script regardless of what it is written in? Or any
other pointers would be appreciated as well.
Thanks.
TTYL
--
Mike A. Harris Linux advocate
Computer Consultant GNU advocate
Capslock Consulting Open Source advocate
Want to run Microsoft Windows software in Linux? You can! VMware allows
you to install and run other operating systems inside a window in X windows.
You can install Windows 95/98/NT/2000, FreeBSD, Solaris, and many more.
3D Games do not work yet, but virtually all office and productivity software
runs excellent. http://www.vmware.com
_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-devel-list