osx - Clear all text on current line from a bash script -



osx - Clear all text on current line from a bash script -

how can cause ctrl u bash script?

ie want remove characters left of cursor on line, , set cursor in column 0.

a workaround printing \r, followed clear right of cursor.

i don't want clear whole terminal screen.

update:

the solution utilize (in php):

echo 'mydata' . "\033[0k\r";

basically can this:

while :; # infinite loop demonstration echo "$random" # print stuff here sleep 0.2 tput cuu1 # move cursor 1 line tput el # clear line done

use man tput more info. see list of capabilities utilize man terminfo

osx bash terminal

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -