Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: perl one liner print columns 2.. last

by Jim (Curate)
on Jan 06, 2013 at 17:14 UTC ( #1011899=note: print w/ replies, xml ) Need Help??


in reply to Re: perl one liner print columns 2.. last
in thread perl one liner print columns 2.. last

If you have both history and Perl, then you probably also have cut.

history | cut -f 2-

On my system, -n suppresses line numbers (but not the leading tab).

history -n

Though it's handy to know -a and @F autosplit command-line idioms for use in some situations, this specific situation is one for which there's a simpler, less arcane way that doesn't require Perl. Also, using cut is less destructive than using Perl because it doesn't convert tabs to spaces as the Perl autosplit trick does. (Of course, this can be remedied by specifying an alternate separator pattern with the -F command-line option, but this is just leading you down the garden path.)

Jim


Comment on Re^2: perl one liner print columns 2.. last
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2014-09-18 20:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (124 votes), past polls