1

I want to hightlight the Warning message appears while running a specific command. If we accidentally run some specific commands(it may be removing essential system pacakges), it shows some warning message before the action which was going to be done.

But the Warning message is not in an highlighted form. Some people may read the Warning message and cancel the operation but some may execute the command without reading the warning message.And finally got his/her system broken.

Example 1:

avinash@linux:~$ sudo apt-get purge firefox
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  firefox* lightdm-remote-session-uccsconfigure* xul-ext-unity* xul-ext-webaccounts*
0 upgraded, 0 newly installed, 4 to remove and 300 not upgraded.
After this operation, 63.1 MB disk space will be freed.
Do you want to continue [Y/n]?

In the above example, there is no need for the Warning message.Because firefox is not an essential package. System will also run smoothly, if we remove firefox package.

Example 2:

avinash@linux:~$ sudo apt-get purge hostname
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  hostname*
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  hostname
0 upgraded, 0 newly installed, 1 to remove and 301 not upgraded.
After this operation, 85.0 kB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
 ?] 

In this example, the hostname package is a must important essential package.If you remove this packge, your system will be broken.

So, is that possible to highlight(In red colour or in bold text) only the Warning Message if that command is intended to produce an Warning Message before doing a particular operation?

WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!

0

You must log in to answer this question.

Browse other questions tagged .