⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex20.sh

📁 一本完整的描述Unix Shell 编程的工具书的所有范例
💻 SH
字号:
#!/bin/bashfunc1 (){echo This is a function.}declare -f        # Lists the function above.echodeclare -i var1   # var1 is an integer.var1=2367echo "var1 declared as $var1"var1=var1+1       # Integer declaration eliminates the need for 'let'.echo "var1 incremented by 1 is $var1."# Attempt to change variable declared as integer.echo "Attempting to change var1 to floating point value, 2367.1."var1=2367.1       # Results in error message, with no change to variable.echo "var1 is still $var1"echodeclare -r var2=13.36         # 'declare' permits setting a variable property                              #+ and simultaneously assigning it a value.echo "var2 declared as $var2" # Attempt to change readonly variable.var2=13.37                    # Generates error message, and exit from script.echo "var2 is still $var2"    # This line will not execute.exit 0                        # Script will not exit here.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -