blackwolf has asked for the wisdom of the Perl Monks concerning the following question:
I've come up with a couple of really hacked ideas to implement this, but the easiest would involve getting the full command line by which the script was invoked, so I could run:
and pump data into P.$originalcmdline = some magic code here ...; open( P, "| prog1 | prog2 | $originalcmdline" );
Anticipating at least one answer, doing something like $originalcmdline = "$0 " . join(' ',@ARGV); won't work - strings in @ARGV could contain whitespace, quotes, double quotes, backslashes, wildcard characters, etc, making safe reconstruction of the command line a real pain.
Any suggestions?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Getting a script's original command line
by merlyn (Sage) on Jun 16, 2000 at 20:31 UTC | |
|
Re: Getting a script's original command line
by mdillon (Priest) on Jun 16, 2000 at 20:35 UTC | |
by merlyn (Sage) on Jun 16, 2000 at 20:40 UTC | |
by blackwolf (Sexton) on Jun 16, 2000 at 20:57 UTC | |
|
Re: Getting a script's original command line
by NorthernDean (Initiate) on Sep 05, 2018 at 21:59 UTC | |
by Discipulus (Canon) on Sep 06, 2018 at 07:06 UTC | |
by Your Mother (Archbishop) on Sep 06, 2018 at 04:34 UTC | |
|
Re: Getting a script's original command line
by cleen (Pilgrim) on Jun 16, 2000 at 22:18 UTC | |
|
Re: Getting a script's original command line
by Aighearach (Initiate) on Jun 17, 2000 at 01:28 UTC |