Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have tried several attempts at this. This is my issue.
Executing my script returns with first clearing the terminal then followed by the response in BOLD letters. This is what I want.
However, after the response is displayed the command line that follows is also in BOLD print and any other commands I enter are also in BOLD print. What I would like to see is that after the response is returned
in BOLD that the comand line returns to the normal unbold format.
I guess I am not clear.
After my script is ran the terminal is cleared and the script echoes back a response and in this csae the word "Offline".
This is returned in BOLD print on the terminal as desired. However, what follows automatically is the command line
which is also in BOLD from which the script was executed from. I do not want the command line to be returned displayed in BOLD type.
This is shown on the terminal at the upper left corner after the sript is executed:
Offline - (Which is highlighted and expected).
jeff@kiki:~/RICI_Switch2$ - (Which is also highlighted but is not desirable. Any further command entries typed on this line is also
highlighted. I would like this command line to return to its normal unbold state).
It would seem to be more portable if you used the tput utility.
tput bold - turns it on.
tput sgr0 - turns it off.
You can use things like "bold=$(tput bold)" and "normal=$(tput sgr0)", then when you want bold
you can use "echo $bold .... $normal" where arbitrary text is the "....".
$ bold=$(tput bold)
$ normal=$(tput sgr0)
$ echo $bold hi there $normal
Note: the "sgr0" is a reset of special modes, it turns off several of them (including things like superscript - ssupm...).
Read the manpage on tput, and the associated manpage on terminfo. The terminfo page has all the special names for the escape sequences. Using the names improves portability some because different terminal (if you are using them) can use different escape sequences. It is also simpler due to the documentation aspect of using the names.