-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrewindday1.sh
More file actions
57 lines (32 loc) · 714 Bytes
/
Copy pathrewindday1.sh
File metadata and controls
57 lines (32 loc) · 714 Bytes
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
echo "hello world"
echo "$0"
varopt=$hostname
echo $(hostname)
#comment
<<COMMENT
this is multiple comment
COMMENT
var1=20
var2="twenty"
readonly var3=200
echo "$var1 $var3 $varopt"
arr1=(1 2 3 hi "hello" guys)
arr1+=(3 42 22)
echo "${arr1[2]}"
echo "all elements in array ${arr1[*]}"
echo "length of array ${#arr1[*]}"
echo "alagh length of array ${#arr1[@]}"
echo "2-6 index elements ${arr1[*]:2:5}"
declare -A assoarray
assoarray=([name]="sai" [age]=24)
echo "assoarray is ${assoarray[name]} ${assoarray[age]}"
var4="hi hello welcome"
echo "length of var4 string ${#var4}"
echo "${var4^^}"
echo "${var4,,}"
echo "${var4/hello/buddy}"
echo "${var4:0:2}"
cat <<EOF
HI HELLO OK
HELLOOK
EOF