-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.sh
More file actions
executable file
·66 lines (58 loc) · 1.53 KB
/
demo.sh
File metadata and controls
executable file
·66 lines (58 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
echo mahin raza
echo "mahin raza"
echo 'mahin raza'
Red_open='\033[0;31m'
Red_close='\033[0m'
Green_open='\033[0;32m'
Green_close='\033[0m'
White_open='\033[0;37m'
White_close='\033[0m'
echo -e "${Green_open}This is in Green${Green_close}"
echo -e "${Red_open}This is in Red${Red_close}"
echo -e "${Green_open}This is in Green${Green_close}"
echo -e "${White_open}This is in White${White_close}"
echo -e "${Green_open}This is in Green${Green_close}"
# we can redirect the error with red color to log file
echo " Multi
Line
String
"
echo "
######### Script started #########
This is a multi-line string
####### Script ended #########
"
echo " Multi \
Line \
String
"
echo "
######### Script started ######### \
This is a multi-line string \
####### Script ended #########
"
"""
Both single and double quotes are used to define strings, but they behave differently in terms of how they handle variables and special characters.
Single Quotes ('):
Treat the enclosed content literally.
No variable expansion or special character interpretation.
echo '$abcd' # Output: $abcd
Double Quotes (""):
Allow variable expansion and interpret certain special characters.
abcd="Hello"
echo "$abcd" # Output: Hello
"""
# yum install -y httpd \
# nginx \
# mysql-server
echo ' Multi \
Line \
String
'
#new line
echo -e "This is new line character \n and this is next line"
#horizontal tab
echo -e "This is new horizontal tab \t and this is next line"
#vertical tab
echo -e "This is new vertical tab \v and this is next line"