-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDay1 Bash.txt
87 lines (39 loc) · 1.04 KB
/
Day1 Bash.txt
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Bash Scripting
echo: It is a Bash builtin command that writes the arguments it receives to the standard output.
=>Display Hello world
1. Using Interactive Shell
echo “Hello world”
Output:
Hello world
2. Using Non-Interactive Shell
Commands
-create a file{ touch helloworld.sh}
-write code { vim helloworld.sh}
#!/bin/bash
echo “Hello world”
-execute permission
chmod +x helloworld.sh
-Run code
./helloworld.sh
Note: If /bin/bash PATH don’t exits then you should use /usr/local/bin/bash
=> Quote in String
There are two types of quoting:
-double quote
-single quote
1. Display single quote
-script
echo “ Name:’Valya’ “
Output:
Name:’Valya’
2. Display Double quote
-script
echo “Country:\”India”\ “
Output:
Country:”India”
=> Display all command
-script
#!/bin/bash -x
echo “hello world”
-output
+echo hello world
hello world