Sunday, May 29, 2011

Bash script cursor control

taken from:

The movement escape sequences are as follows:

        - Position the Cursor:
          puts the cursor at line L and column C.
        - Move the cursor up N lines:
        - Move the cursor down N lines:
        - Move the cursor forward N columns:
        - Move the cursor backward N columns:
        - Clear the screen, move to (0,0):
        - Erase to end of line:
        - Save cursor position:
        - Restore cursor position:
echo -en "\033[s\033[7B\033[1;34m BASH BASH\033[u\033[0m" 
Script to print position of a file in a process:
prints on line 2, column 1 

/bin/echo -en "\033[2J"
while [ 1 ] ; do
/bin/echo -en "\033[2;1H"
echo `cat /proc/5648/fdinfo/1|grep pos`
echo $a

No comments:

Post a Comment