printing to the screen

HPUX 11.0.X / Korn Shell
Hope this makes sense.

I have a little function to place things on the screen using the column and row parameters. Question is, how can I be sure of where the current cursor postion is so that if I print something to the upper right hand corner of the screen, I can again return back to the row (really the next row) where the cursor was originally?

Example: Assume that my current cursor position is at row 52. I call my function to print a message starting at row 20, column 35. How can I return focus back to row 52 (or 53) after I have printed to the screen? Is there a way to grab my current row/column attributes?

   xy \(\) \{
   \#_R= row, _C=column
   _R=$1
   _C=$2
   tput cup $_R $_C

}

I figured my problem out. You can save the current position of the cursor using the command tput sc and then restore the cursor back to the save point by using the command tput rc

Good job google :slight_smile: