-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDemo.sh
More file actions
66 lines (52 loc) · 1.21 KB
/
Demo.sh
File metadata and controls
66 lines (52 loc) · 1.21 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
<< commnt
echo 'Hi All'
echo -e '\033[0;31m Success message here' # color message red
echo -e '\033[0;32m Success message here' # color message green
echo -e '\033[0;33m Success message here' # color message yellow
work="rakesh"
var="singh"
echo "I am ${work} ${var}"
echo ${OSTYPE}
echo ${HOME}
echo ${PATH}
echo ${$}
echo ${SHELL}
sleep 30
echo ${SECONDS}
read -p " Enter your passwd " -s passwd
echo
echo "your password is ${passwd}"
echo
echo "my name is $1 and age is $2"
echo $#
echo $@
echo $*
pwd
currnt_working_Dir=$(pwd)
echo "${currnt_working_Dir}"
date_time=$(date +"%D-%T")
echo ${date_time}
name="my name is Rakesh"
echo "${name}" #my name is Rakesh
echo "${name^}" #My name is Rakesh
echo "${name^^}" #MY NAME IS RAKESH
echo "${name,}" # my name is Rakesh
echo "${name,,}" # my name is rakesh
echo "length of the string is ${#name}"
name="asdfgheyahdgdkj"
echo "${name:0}"
echo "${name:1}"
echo "${name:3}"
echo "${name:1:4}"
echo "${name: -3}"
echo "${name#s*g}" # short
echo "${name##s*g}" # long
echo "${name%g*j}" # ending short
echo "${name%%g*j}" # ending long
string="abcdrakeshabcxyz"
echo "${string/abc/sss}"
echo "${string//abc/sss}"
echo "${string/abc}"
echo "${string//abc}"
commnt