Meaningless Drivel is fun!
The moose likes General Computing and the fly likes Unix Ksh split command Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "Unix Ksh split command" Watch "Unix Ksh split command" New topic

Unix Ksh split command

yuga devi

Joined: Aug 07, 2008
Posts: 22

I am new to unix.

I have the following code to grep the word "System" from my Test.jav and split the output to multiple files of 2 lines each.
My code is :

grep 'System' | split -l 2

which splits correctly and fill the output in the files from the split command xaa, xab,xac...etc.

I want to have my own name in the files like test1,test2,test3 etc.

Please help


fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11955

csplit might be a better one to use... check its man page.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
yuga devi

Joined: Aug 07, 2008
Posts: 22
Thanks for the reply!!
I agree. Here's the link:
subject: Unix Ksh split command
It's not a secret anymore!