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

Re^3: Using Perl saves time....

by TomDLux (Vicar)
on Jul 18, 2005 at 17:55 UTC ( [id://475834]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Using Perl saves time....
in thread Using Perl saves time....

nl - the line numbering utility takes one or more file names on its command line. So nl * cats the contents of all the files with line numers.

46$ ls | wc 15 15 233 47$ nl * | wc 857 3540 29899 48$ ls | nl 1 Makefile 2 RCS 3 Tests 4 ... 15

But you just want the count, not the list, so you would need to | tail -1 | cut -d' ' -f1.

Or to be precise: ls | nl | tr -s ' ' ' ' | tr "\t" ' ' | cut -d' ' -f2

--
TTTATCGGTCGTTATATAGATGTTTGCA

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-16 11:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found