From dbii at interaction.net Sun Aug 7 12:52:57 2005 From: dbii at interaction.net (David Bluestein II) Date: Sun, 7 Aug 2005 14:52:57 -0500 Subject: APM: Free Dr. Dobb's Subscription Message-ID: For anyone who is interested, I received a handful of cards for free subscriptions to Dr. Dobb's magazine ("Software tools for the professional programmer). The process is go to this URL: http://free.ddjsub.com The Keycode is WJCS. Thought some of you might be interested, it has the occasional Perl article. David ----------------------------------------------------------------------- David H. Bluestein II President & Lead Developer dbii at interaction.net ii, inc. http://www.interaction.net -- Specializing in Interactive, Database Driven Websites -- From wwalker at bybent.com Sun Aug 7 13:22:35 2005 From: wwalker at bybent.com (Wayne Walker) Date: Sun, 7 Aug 2005 15:22:35 -0500 Subject: APM: Free Dr. Dobb's Subscription In-Reply-To: References: Message-ID: <20050807202235.GD2892@bybent.com> Oh this note, I'd like to empty a couple of book shelves. I have the following CS mags for anyone who wants to pick them up. Dr Dobb's Journal - Feb/03 thru Jun/05 IEEE "Computer" - 5/02 - 5/05 c/C++ Users Journal - 11/02 12-03 SysAdmin Magazine - 2/02 thru 5/05 Linux Journal - 7/99 thru 12/03 and a few older ones And the piece de' resistance. The Perl Journal, volumes 1 thru 20 (all 20) and 10 TPJs from volume 1 to 18 Wayne On Sun, Aug 07, 2005 at 02:52:57PM -0500, David Bluestein II wrote: > For anyone who is interested, I received a handful of cards for free > subscriptions to Dr. Dobb's magazine ("Software tools for the > professional programmer). The process is go to this URL: > > http://free.ddjsub.com > > The Keycode is WJCS. > > Thought some of you might be interested, it has the occasional Perl > article. > > David > ----------------------------------------------------------------------- > David H. Bluestein II > President & Lead Developer dbii at interaction.net > ii, inc. > http://www.interaction.net > -- Specializing in Interactive, Database Driven Websites -- > > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin -- Wayne Walker wwalker at bybent.com Do you use Linux?! http://www.bybent.com Get Counted! http://counter.li.org/ Perl - http://www.perl.org/ Perl User Groups - http://www.pm.org/ Jabber: wwalker at jabber.gnumber.com AIM: lwwalkerbybent IRC: wwalker on freenode.net From dbii at interaction.net Mon Aug 15 21:01:12 2005 From: dbii at interaction.net (David Bluestein II) Date: Mon, 15 Aug 2005 23:01:12 -0500 Subject: APM: APM Meeting This Wed, 17th Message-ID: <4d7f74159b94a2eafe2661cd58b0bcba@interaction.net> This Wed Mark is going to talk about Creating Graphics with Perl (part II). If you missed part I, that is okay, no prior experience is necessary. Meeting is at 7 pm at ARL (http://austin.pm.org for directions). Dinner at Double Dave's pizza buffet at 11900 Metric Blvd., Ste. F., at 5:45pm'ish. David ----------------------------------------------------------------------- David H. Bluestein II President & Lead Developer dbii at interaction.net ii, inc. http://www.interaction.net -- Specializing in Interactive, Database Driven Websites -- From dbii at interaction.net Tue Aug 16 19:49:20 2005 From: dbii at interaction.net (David Bluestein II) Date: Tue, 16 Aug 2005 21:49:20 -0500 Subject: APM: TheOpenCD Copies Message-ID: I will bring to Wednesday's APM meeting 5 copies of The Open CD (www.theopencd.org) that I picked up at a conference for anyone wants one. If more want them, bring a blank cdr and I'm sure someone can burn additional copies for those who want them. I haven't tried it, but this is a live CD based on ubuntu. Since we've lost our corporate sugar daddy IBM, this is our new swag. See you Wed! David ----------------------------------------------------------------------- David H. Bluestein II President & Lead Developer dbii at interaction.net ii, inc. http://www.interaction.net -- Specializing in Interactive, Database Driven Websites -- From dbii at interaction.net Mon Aug 22 08:09:53 2005 From: dbii at interaction.net (David Bluestein II) Date: Mon, 22 Aug 2005 10:09:53 -0500 Subject: APM: September Meeting Topic Call for Vote Message-ID: We tossed around the idea of a Perl/MySQL session, with focus on SQL tricks, for September. How does that sound to everyone? Who would like to present, as we had several possible candidates: Bill Mark Evan Heath(? there was a fourth but I forget who) Is this of interest to people? Mark, did you attend Mysql UG last week? If so, how was it and should we invite them over? Also, what other topics would you like to hear about in the fall? If you throw something out, we'll make sure we get someone to speak on it. David ----------------------------------------------------------------------- David H. Bluestein II President & Lead Developer dbii at interaction.net ii, inc. http://www.interaction.net -- Specializing in Interactive, Database Driven Websites -- From bill_raty at yahoo.com Wed Aug 24 19:14:28 2005 From: bill_raty at yahoo.com (Bill Raty) Date: Wed, 24 Aug 2005 19:14:28 -0700 (PDT) Subject: APM: Question: How to access command line before its parsed into @ARGV Message-ID: <20050825021428.65029.qmail@web80102.mail.yahoo.com> I'm needing to write a perl program that receives command line arguments that may be double quoted. # This won't work as quotes are removed my $command_line = join ' ', @ARGV; -Bill -Bill Reintarnation: Coming back to life as a hillbilly From rhennig at gmail.com Wed Aug 24 19:40:53 2005 From: rhennig at gmail.com (Randall Hennig) Date: Wed, 24 Aug 2005 21:40:53 -0500 Subject: APM: Question: How to access command line before its parsed into @ARGV In-Reply-To: <20050825021428.65029.qmail@web80102.mail.yahoo.com> References: <20050825021428.65029.qmail@web80102.mail.yahoo.com> Message-ID: <5528c5fe050824194038f813e3@mail.gmail.com> Oh, nevermind, I see the problem. Odd. On 8/24/05, Bill Raty wrote: > I'm needing to write a perl program that receives command line > arguments that may be double quoted. > > # This won't work as quotes are removed > my $command_line = join ' ', @ARGV; > > -Bill > > -Bill > Reintarnation: Coming back to life as a hillbilly > > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin > From bill_raty at yahoo.com Wed Aug 24 19:45:34 2005 From: bill_raty at yahoo.com (Bill Raty) Date: Wed, 24 Aug 2005 19:45:34 -0700 (PDT) Subject: APM: Question: How to access command line before its parsed into @ARGV Message-ID: <20050825024534.20488.qmail@web80106.mail.yahoo.com> Try: perl -e 'print join(" ", @ARGV), "\n"' do "I" see quotes I see: do I see quotes I don't see quotation marks around the personal pronoun, as I had typed. There are no predictive rules I can use on the arguments to reproduce quotes that are lost by the parsing process. I'll settle for a CPAN module. :-) -Bill -Bill Reintarnation: Coming back to life as a hillbilly From dbii at interaction.net Wed Aug 24 20:14:34 2005 From: dbii at interaction.net (David Bluestein II) Date: Wed, 24 Aug 2005 22:14:34 -0500 Subject: APM: Question: How to access command line before its parsed into @ARGV In-Reply-To: <20050825024534.20488.qmail@web80106.mail.yahoo.com> References: <20050825024534.20488.qmail@web80106.mail.yahoo.com> Message-ID: Have you tried either Getopt::Std or Getopt::Long? I don't know if either would work for you purposes, but I've used them before. David On Aug 24, 2005, at 9:45 PM, Bill Raty wrote: > Try: > > perl -e 'print join(" ", @ARGV), "\n"' do "I" see quotes > > I see: > do I see quotes > > I don't see quotation marks around the personal pronoun, as I > had typed. > > There are no predictive rules I can use on the arguments to > reproduce quotes that are lost by the parsing process. > > I'll settle for a CPAN module. :-) > > -Bill > > -Bill > Reintarnation: Coming back to life as a hillbilly > > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin > ----------------------------------------------------------------------- David H. Bluestein II President & Lead Developer dbii at interaction.net ii, inc. http://www.interaction.net -- Specializing in Interactive, Database Driven Websites -- From bill_raty at yahoo.com Wed Aug 24 20:16:09 2005 From: bill_raty at yahoo.com (Bill Raty) Date: Wed, 24 Aug 2005 20:16:09 -0700 (PDT) Subject: APM: Question: How to access command line before its parsed into @ARGV Message-ID: <20050825031609.25957.qmail@web80106.mail.yahoo.com> I will concede it may be a 'C' thing. However, there are other executables in *nix that manage to get the unfiltered command line. The question is there a pure perl way to do the same? Programming XS in AIX is an option of last resort. -Bill Reintarnation: Coming back to life as a hillbilly From bill_raty at yahoo.com Wed Aug 24 20:26:41 2005 From: bill_raty at yahoo.com (Bill Raty) Date: Wed, 24 Aug 2005 20:26:41 -0700 (PDT) Subject: APM: Question: How to access command line before its parsed into @ARGV Message-ID: <20050825032641.28411.qmail@web80104.mail.yahoo.com> Thanks for the inputs. Update: $ENV{'CMD_LINE'} - can't repro on either WinXP64 or AIX GetOpt::Long - has a specific caveat blaming CLI I'm still searching. -Bill Reintarnation: Coming back to life as a hillbilly From brentlavelle at yahoo.com Thu Aug 25 06:35:02 2005 From: brentlavelle at yahoo.com (Brent LaVelle) Date: Thu, 25 Aug 2005 06:35:02 -0700 (PDT) Subject: APM: Question: How to access command line before its parsed into @ARGV In-Reply-To: <20050825032641.28411.qmail@web80104.mail.yahoo.com> Message-ID: <20050825133502.10505.qmail@web32515.mail.mud.yahoo.com> You will not see the "" in Perl or C as the shell eats them. If you want to see the quotes you have to quote them. Look at the second and third examples below: lavelle:~> perl -e 'print join(" ", at ARGV),"\n"' foo "bar" foo bar lavelle:~> perl -e 'print join(" ", at ARGV),"\n"' 'foo "bar"' foo "bar" lavelle:~> perl -e 'print join(" ", at ARGV),"\n"' foo \"bar\" foo "bar" All this quoting nonsense is a shellism, nothing to do with perl. You will see the effect of the quotes (or backslash) when there is some whitespace or quotes in a paticular argument. --- Bill Raty wrote: > Thanks for the inputs. Update: > > $ENV{'CMD_LINE'} - can't repro on either WinXP64 or AIX > > GetOpt::Long - has a specific caveat blaming CLI > > I'm still searching. > > > > -Bill > Reintarnation: Coming back to life as a hillbilly > > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From tim at toolman.org Thu Aug 25 06:47:07 2005 From: tim at toolman.org (Tim Peoples) Date: Thu, 25 Aug 2005 08:47:07 -0500 Subject: APM: Question: How to access command line before its parsed into @ARGV In-Reply-To: <20050825032641.28411.qmail@web80104.mail.yahoo.com> References: <20050825032641.28411.qmail@web80104.mail.yahoo.com> Message-ID: <1124977627.17924.108.camel@tpeoples.dmotorworks.com> How about: $cmdline = join(' ', map { (/\s/) ? "\"$_\"" : $_ } @ARGV); The reason you're not getting the quotes in Perl is because they aren't there; the shell has already removed them in order to parse the command line into an array of strings. The quotes are merely a shell device to tell it not to separate the tokens on whitespace and to treat the whole quoted string as one token. I think this begs the quetion of, "Why are you wanting to recombine your command line into a single string?" The tokens are already parsed for you. Tim. On Wed, 2005-08-24 at 20:26 -0700, Bill Raty wrote: > Thanks for the inputs. Update: > > $ENV{'CMD_LINE'} - can't repro on either WinXP64 or AIX > > GetOpt::Long - has a specific caveat blaming CLI > > I'm still searching. > > > > -Bill > Reintarnation: Coming back to life as a hillbilly > > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin -- From wwalker at bybent.com Thu Aug 25 07:15:30 2005 From: wwalker at bybent.com (Wayne Walker) Date: Thu, 25 Aug 2005 09:15:30 -0500 Subject: APM: Question: How to access command line before its parsed into @ARGV In-Reply-To: <20050825021428.65029.qmail@web80102.mail.yahoo.com> References: <20050825021428.65029.qmail@web80102.mail.yahoo.com> Message-ID: <20050825141530.GA3831@bybent.com> The first layer of quotes is removed by the shell prior to the fork/exec of the perl interpreter, do the quotes can't be gotten by a perl program since they were removed before perl was exec'd On Wed, Aug 24, 2005 at 07:14:28PM -0700, Bill Raty wrote: > I'm needing to write a perl program that receives command line > arguments that may be double quoted. > > # This won't work as quotes are removed > my $command_line = join ' ', @ARGV; > > -Bill > > -Bill > Reintarnation: Coming back to life as a hillbilly > > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin -- Wayne Walker wwalker at bybent.com Do you use Linux?! http://www.bybent.com Get Counted! http://counter.li.org/ Perl - http://www.perl.org/ Perl User Groups - http://www.pm.org/ Jabber: wwalker at jabber.gnumber.com AIM: lwwalkerbybent IRC: wwalker on freenode.net From wwalker at bybent.com Thu Aug 25 07:21:27 2005 From: wwalker at bybent.com (Wayne Walker) Date: Thu, 25 Aug 2005 09:21:27 -0500 Subject: APM: Question: How to access command line before its parsed into @ARGV In-Reply-To: <20050825021428.65029.qmail@web80102.mail.yahoo.com> References: <20050825021428.65029.qmail@web80102.mail.yahoo.com> Message-ID: <20050825142127.GB3831@bybent.com> Upon reflection, and Tim's comment, maybe you are wanting to reuse the quoted args in a system call later. myprog "a compound arg, probably a Windows filename with spaces" 32 safe if in my prog you do: system ("other_prog " . join " ", @ARGV); other_prog would be called via a shell call and would see 11 arguments: sh -c other_progam compound arg, probably a Windows filename with spaces 32 safe If instead you put this in my_prog: system ("other_prog", @ARGV); Then perl will call execvp("other_prog", (list of "other_prog" and the _3_ args in @ARGV) so other_prog will think you ran this at the shell, essentially: other_prog "a compound arg, probably a Windows filename with spaces" 32 safe Wayne On Wed, Aug 24, 2005 at 07:14:28PM -0700, Bill Raty wrote: > I'm needing to write a perl program that receives command line > arguments that may be double quoted. > > # This won't work as quotes are removed > my $command_line = join ' ', @ARGV; > > -Bill > > -Bill > Reintarnation: Coming back to life as a hillbilly > > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin -- Wayne Walker wwalker at bybent.com Do you use Linux?! http://www.bybent.com Get Counted! http://counter.li.org/ Perl - http://www.perl.org/ Perl User Groups - http://www.pm.org/ Jabber: wwalker at jabber.gnumber.com AIM: lwwalkerbybent IRC: wwalker on freenode.net From tmcd at panix.com Thu Aug 25 14:29:28 2005 From: tmcd at panix.com (tmcd@panix.com) Date: Thu, 25 Aug 2005 16:29:28 -0500 (CDT) Subject: APM: Question: How to access command line before its parsed into @ARGV In-Reply-To: <1124977627.17924.108.camel@tpeoples.dmotorworks.com> References: <20050825032641.28411.qmail@web80104.mail.yahoo.com> <1124977627.17924.108.camel@tpeoples.dmotorworks.com> Message-ID: On Thu, 25 Aug 2005, Tim Peoples wrote: > The reason you're not getting the quotes in Perl is because they > aren't there; the shell has already removed them in order to parse > the command line into an array of strings. The quotes are merely a > shell device to tell it not to separate the tokens on whitespace and > to treat the whole quoted string as one token. Quoting also tells the shell not to expand certain metacharacters: " still allows $ interpretation, \ interpretation, and others, while ' allows much less. Bill wrote: > I will concede it may be a 'C' thing. However, there are other > executables in *nix that manage to get the unfiltered command line. That's not possible. > How about: > > $cmdline = join(' ', map { (/\s/) ? "\"$_\"" : $_ } @ARGV); Whitespace isn't the only problematic character. Also, you use double quotes, and that allows for far more interpretation inside, which you generally don't want. Consider mycmd arg1 arg2 '*' arg4 mycmd arg1 "arg2'rest" mycmd arg1 'arg2"rest' mycmd one_backslash\\after_parsing mycmd arg1 "arg2\"'rest" mycmd 'arg1$rest' It's a very difficult problem to re-add proper quoting in general. In the past, I've tended to just single-quote each argument. This still fails if any argument contains at least one single quote ('). Doing a cursory search at CPAN, though, via with "quoting shell arguments" as the search, indicates that String::ShellQuote may do what you want. That's just the hit I saw on the first page; there may be other packages. > I think this begs the quetion of, "Why are you wanting to recombine > your command line into a single string?" The tokens are already > parsed for you. To be precise, it doesn't "beg the question", it "leaves unanswered the underlying question". beg the question: Take for granted or assume the truth of the very thing being questioned. For example, "Shopping now for a dress to wear to the ceremony is really begging the question---she hasn't been invited yet". This phrase, whose roots are in Aristotle's writings on logic, came into English in the late 1500s. In the 1990s, however, people sometimes used the phrase as a synonym of "ask the question" (as in 'The article begs the question: "What are we afraid of?"'). It can convenient to pass off a command line to the shell, as in system("mycommand '$arg1' '$arg2' >out.txt 2>&1 || rm '$lockfile'"); Yes, all of that can be done in Perl, but I'd have to implement the saving of file descriptors, opening of the output file, unlinking, ... In such cases, I've known that the arguments can't have "'". -- Tim McDaniel; Reply-To: tmcd at panix.com From bill_raty at yahoo.com Thu Aug 25 15:23:59 2005 From: bill_raty at yahoo.com (Bill Raty) Date: Thu, 25 Aug 2005 15:23:59 -0700 (PDT) Subject: APM: Question: How to access command line before its parsed into @ARGV Message-ID: <20050825222400.41351.qmail@web80105.mail.yahoo.com> Folks, In Linux one can access the pre-parsed command line given to exec, using CPAN module Proc::ProcessTable . It seems to reflect the assertions that quotes are removed by the shell before being given to exec. =for example use strict; use warnings; use Proc::ProcessTable; my $proc_table = Proc::ProcessTable->new(); my ($process) = grep $_->{pid} == $$, @{ $proc_table->table() }; my $cmndline = $process->{cmndline}; print "Command line for pid=$$: ($cmndline)\n"; =cut The underlying problem is I need to gather forensics on an executable running on AIX that hangs intermittently. The idea was to put a command proxy in its place (perl) that captures invocation arguments, STDIN, invokes the miscreant, and logs its STDOUT, STDERR and other vitals for later analysis. Hopefully I'll be able to gather information for logging a support ticket with the producer of the executable. Presumably the quotes I supply to this program don't reach it, and I can apply the cmndline from above to an 'exec', 'open', or 'open3'. -Bill Reintarnation: Coming back to life as a hillbilly From tmcd at panix.com Thu Aug 25 18:56:39 2005 From: tmcd at panix.com (tmcd@panix.com) Date: Thu, 25 Aug 2005 20:56:39 -0500 (CDT) Subject: APM: Question: How to access command line before its parsed into @ARGV In-Reply-To: <20050825222400.41351.qmail@web80105.mail.yahoo.com> References: <20050825222400.41351.qmail@web80105.mail.yahoo.com> Message-ID: On Thu, 25 Aug 2005, Bill Raty wrote: > In Linux one can access the pre-parsed command line given to > exec, using CPAN module Proc::ProcessTable . It seems to > reflect the assertions that quotes are removed by the shell > before being given to exec. It cannot access "the pre-parsed command line". Linux sees only execve, in which the arguments to the command are already separated into separate strings. What Proc::ProcessTable reports is just a space-separated concatenation of the arguments that the kernel saw. For example, just now on my system (014.pl is the Proc::ProcessTable test program you posted): tmcd 1045 $ man Proc::ProcessTable::Process Reformatting Proc::ProcessTable::Process(3pm), please wait... tmcd 1046 $ foo='\' tmcd 1049 $ local/test/014.pl arg1 arg2 arg3 "abc$foo more \$$$ !1045 '" Command line for pid=18064: (/usr/bin/perl -w local/test/014.pl arg1 arg2 arg3 abc\ more $2178 man Proc::ProcessTable::Process ' ) Note that the output only vaguely resembles the command line, because the shell expanded all sorts of things (variables, \, $, !) and split the arguments itself. And the output is not usable, not just due to quotes and whitespace, but due to other items. > The underlying problem is I need to gather forensics on an > executable running on AIX that hangs intermittently. The idea was > to put a command proxy in its place (perl) that captures invocation > arguments, STDIN, invokes the miscreant, and logs its STDOUT, STDERR > and other vitals for later analysis. Hopefully I'll be able to > gather information for logging a support ticket with the producer of > the executable. It's always helpful to give the underlying problem you're trying to solve, so thank you. Do you know what kinds of arguments the program will take? If there are no shell metacharacters, then things become simpler. Off the top of my head and untested, a simple test is: #! /bin/sh realProgram='/usr/local/bin/underlying_command' ( echo 'Beginning run of miscreant' date env for f do echo "argument: '$f'" done ) > /tmp/log-miscreant tee -a /tmp/log-miscreant | $realProgram "$@" 2>&1 | tee -a /tmp/log-miscreant I'm uncertain about the "tee -a" business: two programs running at the same time outputting to the same file. I'm hoping that it opens the file in APPEND mode, so no output will be lost. -- If you don't care about correlating the standard input with the standard ouput, then use two different output files. That also puts standard error into standard output. That also loses the return code from $realProgram. Whether that's a problem in your site's usage only you can say. > Presumably the quotes I supply to this program don't reach it, and I > can apply the cmndline from above to an 'exec', 'open', or 'open3'. Why do you want to supply a command line to exec(), when you already have the arguments you need in @ARGV?! exec $realProgram @ARGV; die "exec failed: $realProgram: $? $!, "; @ARGV in Perl corresponds to "$@" in the modern shell. -- Tim McDaniel; Reply-To: tmcd at panix.com From wwalker at bybent.com Thu Aug 25 19:41:50 2005 From: wwalker at bybent.com (Wayne Walker) Date: Thu, 25 Aug 2005 21:41:50 -0500 Subject: APM: Question: How to access command line before its parsed into @ARGV In-Reply-To: <20050825222400.41351.qmail@web80105.mail.yahoo.com> References: <20050825222400.41351.qmail@web80105.mail.yahoo.com> Message-ID: <20050826024150.GB3436@bybent.com> Bill, and all APM folks, The guys that wrote the original shells were very smart. While perl can probably solve Bill's problem, the shell can probably solve it in 5 lines. (--noprofile is a bash/sh thing on linux; find the equivalent thing in AIX's /bin/sh, I've no AIX box to check). This should do everything you need: mv miscreant miscreant.real touch miscreant chmod 755 miscreant vim miscreant (emacs might work, by why take chances?? :) ---------------------------------- #!/bin/sh --noprofile # Store the environment for later perusal env > /tmp/env.$$ # Read stdin and store it for later perusal cat > /tmp/stdin.$$ # The "'s around $@ are critical (man sh, then search for \$\@ or $@ # according to what pager you are using # run the real miscreant saving stdout and sterr $0.real "$@" < /tmp/stdin.$$ > /tmp/stdout.$$ 2> /tmp/stderr.$$ # feed stdout and stderr to whatever called miscreant cat /tmp/stdout.$$ cat /tmp/stderr.$$ 1>&2 ---------------------------------- $@ will expand in a way that recreates quoting with functional exactness (something that didn't have/need quotes will get quoted, but the shell will rip them back off such that it will exactly mimic the original calling). This will only not work if there is a time sensitive issue with the interleaving of stdout and stderr. That is a rare situation, but I have seen it. Wayne On Thu, Aug 25, 2005 at 03:23:59PM -0700, Bill Raty wrote: > Folks, > > In Linux one can access the pre-parsed command line given to > exec, using CPAN module Proc::ProcessTable . It seems to > reflect the assertions that quotes are removed by the shell > before being given to exec. > > =for example > > use strict; > use warnings; > use Proc::ProcessTable; > > my $proc_table = Proc::ProcessTable->new(); > my ($process) = grep $_->{pid} == $$, @{ $proc_table->table() > }; > my $cmndline = $process->{cmndline}; > print "Command line for pid=$$: ($cmndline)\n"; > > =cut > > The underlying problem is I need to gather forensics on an > executable running on AIX that hangs intermittently. The idea > was to put a command proxy in its place (perl) that captures > invocation arguments, STDIN, invokes the miscreant, and logs > its STDOUT, STDERR and other vitals for later analysis. > Hopefully I'll be able to gather information for logging a > support ticket with the producer of the executable. > > Presumably the quotes I supply to this program don't reach it, > and I can apply the cmndline from above to an 'exec', 'open', > or 'open3'. > > > > -Bill > Reintarnation: Coming back to life as a hillbilly > > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin -- Wayne Walker wwalker at bybent.com Do you use Linux?! http://www.bybent.com Get Counted! http://counter.li.org/ Perl - http://www.perl.org/ Perl User Groups - http://www.pm.org/ Jabber: wwalker at jabber.gnumber.com AIM: lwwalkerbybent IRC: wwalker on freenode.net From bill_raty at yahoo.com Fri Aug 26 08:42:25 2005 From: bill_raty at yahoo.com (Bill Raty) Date: Fri, 26 Aug 2005 08:42:25 -0700 (PDT) Subject: APM: Question: How to access command line before its parsed into @ARGV Message-ID: <20050826154225.26919.qmail@web80108.mail.yahoo.com> Wayne!, Dude!, That's totally SAH-WEET! -Bill Reintarnation: Coming back to life as a hillbilly From wwalker at bybent.com Fri Aug 26 09:03:29 2005 From: wwalker at bybent.com (Wayne Walker) Date: Fri, 26 Aug 2005 11:03:29 -0500 Subject: APM: Question: How to access command line before its parsed into @ARGV In-Reply-To: <20050826154225.26919.qmail@web80108.mail.yahoo.com> References: <20050826154225.26919.qmail@web80108.mail.yahoo.com> Message-ID: <20050826160329.GA3776@bybent.com> That's what is left in your head after 20 years of beating your head on a teletype, er... monitor... On Fri, Aug 26, 2005 at 08:42:25AM -0700, Bill Raty wrote: > Wayne!, Dude!, > > That's totally SAH-WEET! > > -Bill > Reintarnation: Coming back to life as a hillbilly > > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin -- Wayne Walker wwalker at bybent.com Do you use Linux?! http://www.bybent.com Get Counted! http://counter.li.org/ Perl - http://www.perl.org/ Perl User Groups - http://www.pm.org/ Jabber: wwalker at jabber.gnumber.com AIM: lwwalkerbybent IRC: wwalker on freenode.net From mark.lehmann at gmail.com Wed Aug 31 08:40:19 2005 From: mark.lehmann at gmail.com (Mark Lehmann) Date: Wed, 31 Aug 2005 10:40:19 -0500 Subject: APM: Fwd: [pm_groups] Assist Perl Mongers Hit by Katrina In-Reply-To: References: Message-ID: <8fa2a63305083108406c12e280@mail.gmail.com> ---------- Forwarded message ---------- From: James Keenan Date: Aug 30, 2005 2:06 PM Subject: [pm_groups] Assist Perl Mongers Hit by Katrina To: PM Groups Cc: neworleans-pm at pm.org Last December I had the pleasure of attending and speaking at a meeting of the New Orleans Perlmongers chapter (http://neworleans.pm.org/). I was looking forward to a return visit. Needless to say, that's not in the cards in the near future. My guess is that many of our fellow New Orleans Perl hackers, as well as those in other cities devastated by Hurricane Katrina such as Gulfport, Biloxi and Mobile, will have their lives disrupted for many months to come. It occurs to me that one way in which we could ease this disruption would be ... ... employment. Chances are that some of these folks will be out of work and circulating their r?sum?s. If you are in the position to hire Perl programmers, perhaps you could move the r?sum?s of the New Orleans folk to the top of the stack. (And since we're talking employment, let me add that, re my other friends in New Orleans, one is a musician and one is an art historian. So if you're looking for people in those fields, give me a shout.) Jim Keenan Perl Seminar NY -- Request pm.org Technical Support via support at pm.org pm_groups mailing list pm_groups at pm.org http://mail.pm.org/mailman/listinfo/pm_groups -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/austin/attachments/20050831/7ac1bb63/attachment.html From chris at chrisbaker.net Wed Aug 31 15:32:15 2005 From: chris at chrisbaker.net (Christopher Baker) Date: Wed, 31 Aug 2005 17:32:15 -0500 Subject: APM: Message One In-Reply-To: <431631A7.2040504@austin.rr.com> References: <431631A7.2040504@austin.rr.com> Message-ID: <20050831173200.27CD.CHRIS@chrisbaker.net> Is anyone here with Message One? Write back privately please. Chris ============================================================ "Peace, commerce, and honest friendship with all nations--entangling alliances with none, I deem the essential principles of our government...." --Thomas Jefferson 1st Inaugural Address, 1801 ============================================================ Chris Baker -- www.chrisbaker.net chris at chrisbaker.net, chrisbaker at iname.com "When you stop growing, you start dying."