Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Gathering current ksh shell aliases in perl

by JavaFan (Canon)
on Apr 26, 2010 at 21:49 UTC ( [id://836986]=note: print w/replies, xml ) Need Help??


in reply to Gathering current ksh shell aliases in perl

Unix OS don't have much of an API to introspect another process - and certainly not not for things that are very program specific. Just as ikegami said, if the parent process doesn't tell, there's no way to retrieve that bit of information. (Well, I guess that if your program runs as root, you may be able to poke around in a process memory - given enough knowledge of the internals of the version of your ksh, you could in theory reconstruct the aliases. But I wouldn't recommend that.)

Replies are listed 'Best First'.
Re^2: Gathering current ksh shell aliases in perl
by pobocks (Chaplain) on Apr 27, 2010 at 03:30 UTC

    Just out of curiosity, what operating systems do have that kind of API?

    I vaguely recall Plan 9 having some level of FS type access to process internal state, but I may be pulling that out of the ether.

    for(split(" ","tsuJ rehtonA lreP rekcaH")){print reverse . " "}print "\b.\n";
      Some OSses have an API to get some introspection about processes. Think SUNs Dtrace, or HPs Glance. I guess one could even consider /proc to be an API to get some introspection.

      But I don't know of an OS that allows querying for aliases.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://836986]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-03-29 01:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found