SHELL SCRIPT Write at the right of the shell window
Hello all,
Is there an easy way to write at the right of a shell window in shell script ? For example: My service [at the left]: OK [at the right] Any help would be much appreciated. |
Probably an easy obvious way but all that springs to mind is:
Code:
string="My service:" Code:
printf "%s%$(($(stty size | cut -d' ' -f2)-${#string}))s" "$string" "OK" |
Thank you slakmagik! I wanted to use the number of rows in a script once but $LINES isn't available inside scripts. Much help indeed.
That fixes that. Code:
#!/bin/env /bin/sh |
Glad it helped you both. :)
|
All times are GMT -5. The time now is 11:00 AM. |