change the output

I have a applicaton , when run /tmp/my_script , that will output the result to the screen ( as below ) , the output is very long ( about 1500 lines ) , I have a program ( as below ) that will show the output with function 1 > 1 , it works fine , however , the output only show page 1 of this 1500 lines ( round 60 lines output is shown ) , can advise what is wrong , how to output all 1500 lines ? besides , if I want the output only have fisrt two column ( date & time in my case ) , the number column do not show , can advise how to change my program ? thx in advance.

the result

04/15/07 01:00:00 1 8 7 8 5 8 4 5 5 7
04/15/07 02:00:00 1 2 58 7 5 6 4 1 8
"
"
"
(total 1500 lines )

My program

#vi /tmp/my_program
#/bin/ksh
/tmp/my_script <<EOF
sleep 1
sleep
1
EOF

Just pipe the output to cut or awk as shown below:

/tmp/my_script | cut -d " " -f 1,2

or

/tmp/my_script | awk '{print $1, $2}'

Regards

for my first question , why it only show the page 1 , it is because it is wait to press "enter" key to next page , can advise if I want to add the "enter" command to my program , what can i do ? thx

#vi /tmp/my_program
#/bin/ksh
/tmp/my_script <<EOF
sleep 1
1
"enter"
"enter"
sleep 1
1
EOF

Not sure what you're trying to do with the script "/tmp/myprogram".
Besides of that, the shebang (the first line) of your script isn't proper, it should be:

#!/bin/ksh

Anyway, did you get the right output with the awk or cut command?

Regards

thx reply ,

for my first question , I can get all those 1500 lines but the application need to press "enter" key when I want go to next page ( 1500 lines have many pages ) , so I want to ask how to add the enter to my program , just like some unix key ^M etc.

Not sure if you can use the yes command, but you can try it:

yes "" | /tmp/my_script | awk '{print $1, $2}'

At the end you can get a "broken pipe" message, but don't worry you can just ignore it.

Regards