Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
on
CREATING COLORFUL SCRIPT
carried out as part of the course (CS1551) Submitted by
of
BACHELOR OF TECHNOLOGY
In
This is to certify that the project entitled “Creating Colorful Script” is a bonafide work carried out as part
of the course Computer & Communication, under my guidance by Stuti Pandey, & Tamanna Sandhir
students of 5th Semester at the Department of Computer & Communication Engineering , Manipal
University Jaipur, during the academic semester 5th , in partial fulfillment of the requirements for the
award of the degree of Bachelor of Technology in Computer & Communication Engineering, at MUJ,
Jaipur.
Place:
I hereby declare that the project entitled “Delta Modulation Encoder and Decoder” submitted as
part of the partial course requirements for the course Data Communication Lab, for the award of the
degree of Bachelor of Technology in Computer & Communication Engineering at Manipal University Jaipur
during the 5th, November, 2018 semester, has been carried out by me. I declare that the project has not
formed the basis for the award of any degree, associate ship, fellowship or any other similar titles
elsewhere.
Further, I declare that I will not share, re-submit or publish the code, idea, framework and/or any
publication that may arise out of this work for academic or profit purposes without obtaining the prior
Place:
Date:
ABSTRACT
We have to use terminal each & everyday for performing different tasks no
matter what exact thing we are building. Tasks like automation demands us
to write bash scripts. When we use different commands like npm
install or yarn or brew install something we can see colorful instructions and
messages which makes it more readable and user-friendly.
With some pretty easy tricks, we can also make our scripts more readable
and enjoyable experience for the users. So, lets learn it -
If we echo something on the screen it’ll be printed with the default color
settings of our terminal.
INTRODUCTION :
Shell scripts commonly used ANSI escape codes for color output.
Following table shows Numbers representing colors in Escape
Sequences.
The numbers in the above table work for xterm terminal.Result may
vary
for other terminal emulators.
The "\033[" begins the escape sequence.You can also use "\e["
instead
of "\033[". COLOR specifies a foreground color, according to the
table
above.The "m" terminates escape sequence, and text begins
immediately
after that.
The problem with above statement is that the blue color that starts
with the 32 color code is never switched back to the regular color,
so
any text you type after the prompt and even prompt also is still in
the
Green color.
echo -e "\033[0m"
Now you won't see anything new on the screen, as this echo
statement
was not passed any string to display. But it has done its job,
which
was to restore the normal viewing mode. Whatever yor type now will
be
avoid of any fancy effects.
Combining all these Escape Sequences, you can get more fancy
effect.
Use the following template for writing colored text on a colored
background.
#!/bin/bash
clear
echo -e "\033[1m Hello World"
# bold effect
echo -e "\033[5m Blink"
# blink effect
echo -e "\033[0m Hello World"
# back to noraml
echo -e -n "\033[0m"
# back to noraml
echo -e "\033[41m Hello World"
echo -e "\033[42m Hello World"
echo -e "\033[43m Hello World"
echo -e "\033[44m Hello World"
echo -e "\033[45m Hello World"
echo -e "\033[46m Hello World"
1. Wikipeida
2. Bashguru.com