pijush has asked for the wisdom of the Perl Monks concerning the following question:
I am facing a problem to execute a command using system. I have written following script to copy a file from ClearCase.
In the above code what clt setview is doing it is setting a view, but it also spawns a new child shell and from the child shell /vobs/qa/common/yy.txt file is visible, but not from the parent shell. So the above script fails to copy yy.txt file. I have also tried with following command.mkdir ("xxxx",0755); #xxxx has the absolute path system ("clt setview zzzzz-view; \`cp /vobs/qa/common/yy.txt xxxx\`") +; print "Copy has completed successfully\n";
But it is giving error. Can anybody please tell me how can I execute copy command in child shell instead of the parent shell?system (". clt setview zzzzz-view; \`cp /vobs/qa/common/yy.txt xxxx\` +");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to execute command in child shell from parent shell?
by Abigail-II (Bishop) on Jan 05, 2004 at 16:39 UTC | |
by pijush (Scribe) on Jan 05, 2004 at 17:11 UTC |