Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: command line history?

by ikegami (Pope)
on Dec 10, 2009 at 17:26 UTC ( #812253=note: print w/replies, xml ) Need Help??

in reply to command line history?

Perhaps you should check what error you got!
$ perl -e'print `history` // die($? == -1 ? $! : "\$?=$?")' No such file or directory at -e line 1.

history is a shell command. Just like you can't execute a line of Perl code without loading Perl, you can't execute a line of sh code without loading sh. Here's how you can do that:

$ perl -e'sh -c print `history` // die($? == -1 ? $! : "\$?=$?")' $

Unfortunately, that doesn't print anything either. But that's the shell doing that:

$ sh -c history $

I tried a few things quick, but they didn't work. How to fix is is beyond my knowledge and it has nothing to do with Perl. Consult your shell's documentation.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2020-06-04 06:05 GMT
Find Nodes?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?

    Results (30 votes). Check out past polls.