编辑代码

#JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。
#echo "Hello world  -  sh.jsrun.net"

# myUrl="https://www.google.com"
# unset myUrl
# echo $myUrl

# readonly myUrl
# myUrl="https://www.runoob.dom"

# your_name="tom"
# echo $your_name

# your_name="jarry"
# echo ${your_name}

# for skill in Ada Coffe Action Java; do
#     echo "I am good at ${skill} Script"
# done

# for skill in tom jarry xiaoli mingming; do 
#     echo "I like ${skill} in the cat and mouse"
# done

# my_string='Hello world!'

# mystring="Hello world!"

# echo $my_string   $mystring

# declare -i my_integer=42
# echo $my_integer

# my_array=(1 2 3 4 5 6 7)
# echo $my_array

# declare -A associative_array
# associative_array["name"]="John"
# associative_array["age"]=30

# echo $PATH

# your_name="runoob"
# str="Hello,I know you are \"$your_name\"! \n"
# echo -e $str

# your_name="boring"
# my_str="hello everyone,I hear $your_name com here very happy !\n "
# echo -e $my_str

# 拼接字符串
# 双引号拼接
# your_name="runable"

# first_1="hello,"$your_name"!"
# first_2="hello,${your_name}!"
# echo $first_1,$first_2
# # 单引号拼接
# second_1='hello,'$your_name'!'
# second_2='hello,${your_name}!'
# echo $second_1,$second_2

# 获取字符串长度
string="abcd"
echo ${#string} 
 
# 等价于

string="abcd"
echo ${#string[0]}