Solaris 10 - split with numeric suffix

I need to split file with numeric suffix in Solaris 10. Example:-

bash-3.2# more testfile_split.txt
this is line 1
this is line 2

I use split -l 1 testfile_split.txt testfile_split_ . This will output,


-d option doesn't seem to work on Solaris 10.


You can write a small custom script:

awk '{ print > "testfile_split_"i++ }' testfile_split.txt

When you want a suffix with leading zeroes, try

awk '{ out=sprintf ("testfile_split_%04d", i++); print > out }' testfile_split.txt

Need Your Help

hide button with class x on document.ready function

javascript jquery kendo-grid

I am using kendo Custom Command in my application and i want to display Add button with each record and when user click on it, program replace Add button with remove... i haven't managed that in do...