in reply to help on system function
In general, shell builtin commands are only meaningful in the context of an interactive shell, so trying to use them from within a perl script usually won't make sense. Note that each "system()" call in perl invokes a new, distinct shell process that executes whatever command is passed in the call, so there is no shell command history in that context -- in other words, even if the "history" builtin works from within the system call, it will just return an empty result.
Maybe if you provide a snippet of your code, and/or some more detail about what you're trying to accomplish, someone here can suggest a simple way to do what you want.
As a wild guess at that, I wonder if maybe your current perl script is executing a bunch of system calls, and you want to log the all of them; why not just open a log file at the start of the script, and each time you make a system call, print a line to that log?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: help on system function
by Anonymous Monk on Jan 05, 2003 at 19:02 UTC | |
by graff (Chancellor) on Jan 05, 2003 at 19:26 UTC | |
by Anonymous Monk on Jan 05, 2003 at 19:49 UTC | |
by vek (Prior) on Jan 05, 2003 at 19:23 UTC |