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,

testfile_split_aa
testfile_split_ab

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

Answers


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 asp.net-mvc kendo-grid kendo-asp.net-mvc

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...