ex15.sh

来自「Shall高级编程」· Shell 代码 · 共 37 行

SH
37
字号
#!/bin/bash# Naked variablesecho# When is a variable "naked", i.e., lacking the '$' in front?# When it is being assigned, rather than referenced.# Assignmenta=879echo "The value of \"a\" is $a."# Assignment using 'let'let a=16+5echo "The value of \"a\" is now $a."echo# In a 'for' loop (really, a type of disguised assignment):echo -n "Values of \"a\" in the loop are: "for a in 7 8 9 11do  echo -n "$a "doneechoecho# In a 'read' statement (also a type of assignment):echo -n "Enter \"a\" "read aecho "The value of \"a\" is now $a."echoexit 0

⌨️ 快捷键说明

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