Re: Probs with system command in SPL
Posted in 1996
Dirk, You have run across another Informix Bug! In version 6 and higher, the system command doesn't function like it did in earlier versions. It no longer passes the users environment to the system command. Hence the command run by system is run from the root (/) directory and often the user doesn't have write permission there. My users have got around this by using two different methods. 1) Include the path of the command i.e. system ("/usr/bin/ls "); 2) Or if the command needed certain environment variables set, call a script in the system command which has the environment variables set in side it, along with the command that you really wanted to run. Keep in mind that the path to the script would have to be hard-coded too. 3) A third option which I use is to create a stored procedure with the same name as the command I wish to run. In that procedure, I call a function which sets the environment variables and runs the system command. Not pretty but they all work. I hope this helps! Also, the bug number for this problem is 38429. Tracy > > Hi out there, my name is Dirk Schnorpfeil and i am currently working with > Informix SE V6.0 and SOLARIS 2.3. > > I've got serious problems with the system command to start a unix command > out of a stored procedure, because i ever get the error message > > "668:system command cannot be executed > 1:not owner" > > I tried using different shells (sh and csh) and prooved all environment- > variables as PATH, DBTEMP, SHELL, etc... > > Any ideas??? > > > Many thanks in advance, > > > Dirk Schnorpfeil > *** Dirk Schnorpfeil Dortheenstr. 17 Bochum Germany *** > *********************************************************************** > +++ Looking out for EMU-Morpheus Sounds, mail me if you hear of them+++ > -- ========================================================================= = Tracy W. Nedd = = Banctec Inc. - DBA = = Silver Spring, Md = = tracyn@asd.banctec.com = ========================================================================= = ALL RIGHTS RESERVED. = = This posting is copyright and may be used only for the purposes = = of professional study, or the professional exchange of information. = = Use of this posting by any commercial organization for the purposes = = of vilifying another is explicitly prohibited. = =========================================================================