loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.37158211700252775","path":"main.sh","file":{"path":"main.sh","content":{"asEncoding":{"base64":"IyBUbyByZXBsYWNlIGZpcnN0LCB1c2UgJHtwYXJhbWV0ZXIvcGF0dGVybi9zdHJpbmd9Cgp2MT0iSSBsb3ZlIFN1emkgYW5kIE1hcnJ5IgplY2hvICIke3YxL1N1emkvU2FyYX0iCgp2Mj0iSSBsb3ZlIFN1emkgYW5kIE1hcnJ5Igp2Mz0iU2FyYSIKZWNobyAiJHt2Mi9TdXppLyR2M30iCgoKCiMgVG8gcmVwbGFjZSBhbGwsIHVzZSAke3BhcmFtZXRlci8vcGF0dGVybi9zdHJpbmd9Cm1lc3NhZ2U9J1RoZSBzZWNyZXQgY29kZSBpcyAxMjM0NScKZWNobyAiJHttZXNzYWdlLy9bMC05XS9YfSIKCnY0PSJTdXp5LCBTdXp5LCBTdXp5Igp2NT0iU2FyYSIKZWNobyAiJHt2NC8vU3V6eS9TYXJhfSIKCgoKdjY9JChlY2hvICR2MiB8IHNlZCAicy9TdXppLyR2My9nIikKCmVjaG8gJHY2Cgp2Nz0kKHNlZCAicy9TdXppLyR2My9nIiA8PDwgIiR2MiIpCgplY2hvICR2NwoKCgplY2hvICJJIGxvdmUgU3V6aSBhbmQgTWFycnkiID4gbG92ZXJzLnR4dAoKdjg9JCg8bG92ZXJzLnR4dCkKdjk9IiR7djgvU3V6aS9TYXJhfSIKCmVjaG8gJHY5CgplY2hvICIke3Y5L01hcnJ5L0plc2ljYX0iID4gbG92ZXJzLnR4dAoKZWNobyAkKDxsb3ZlcnMudHh0KQ=="},"asBuffer":null},"loaded":true}}
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
# To replace first, use ${parameter/pattern/string}

v1="I love Suzi and Marry"
echo "${v1/Suzi/Sara}"

v2="I love Suzi and Marry"
v3="Sara"
echo "${v2/Suzi/$v3}"



# To replace all, use ${parameter//pattern/string}
message='The secret code is 12345'
echo "${message//[0-9]/X}"

v4="Suzy, Suzy, Suzy"
v5="Sara"
echo "${v4//Suzy/Sara}"



v6=$(echo $v2 | sed "s/Suzi/$v3/g")

echo $v6

v7=$(sed "s/Suzi/$v3/g" <<< "$v2")

echo $v7



echo "I love Suzi and Marry" > lovers.txt

v8=$(<lovers.txt)
v9="${v8/Suzi/Sara}"

echo $v9

echo "${v9/Marry/Jesica}" > lovers.txt

echo $(<lovers.txt)