Syntactic Confectionery Delight | |
PerlMonks |
Gathering current ksh shell aliases in perlby kreon3 (Novice) |
on Apr 26, 2010 at 20:55 UTC ( [id://836980]=perlquestion: print w/replies, xml ) | Need Help?? |
kreon3 has asked for the wisdom of the Perl Monks concerning the following question: I am writing a script that uses the aliases of the current ksh shell and processes them. I am running into an issue where any execution (system, ``, open piping) of the "alias" command creates a new shell instance and does not gather my current aliases. I have tried a variety of approaches so far from the simple ways: my $alias_str = `alias`;my $alias_str_2 = `. alias`; my $res = qx(alias); open (PIPE, "alias |"); To even complex methods:
Nothing appears to be working because perl or ksh creates a new shell instance preventing gathering of the current shell's aliases. Anyone have any ideas on how to pull the ksh aliases into perl? Thanks.
Back to
Seekers of Perl Wisdom
|
|