Hi - > -----Original Message----- > From: Mark Goland [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 15, 2003 7:56 AM > To: perl > Subject: waitpid > > > Hello Perl lovers, > > I am developing a script which runs in TCSH 6.x shell. I have > two questions > > 1. I need to be able to set an global enviernment variable. The > shell has a > build in command setenv which would enable me to do what I need. This is > what I try, > > system("setenv DESTDIR /mnt"); > > ...but this fails , by hand in works great. Source has the same > problme. Any > ideas ??? > > 2. I need to run a few external commands sequantialy. Run one > wait on it to > compleate run the others.... a sample command would be > > system("cat cab.??|tar vxz -C ${DESTDIR}"); > > In C I would usually fork and waitpid on child, I was wondering > if there is > a short trick to this in Perl. ( I know IPC::OpenX returns pid > and I can do > a waitpid on it ) . > > Thanx in advance, > Mark > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
1. ??? 2. system ($cmd) and `$cmd` do _wait_ for the command to finish before returing (the difference being system retuns the command's return code and `` returns the output). A series of these should do what you want. Aloha => Beau; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]