符號的用法

2021-10-14 08:41:50 字數 627 閱讀 8939

引用變數時,使用 $ 符號直接來進行引用,以及包括迴圈變數;

[root@localhost ~]# x=100

[root@localhost ~]# echo $x

100使用 $ 作為變數表示式。

[root@localhost ~]# x=100  [root@localhost ~]# echo "x = $xy" x = 100

使用 $ 獲取變數字串長度。

[root@localhost etc]# s=hello 

[root@localhost etc]# echo "s.length = $" 

s.length = 5

表示式求值

使用 [ ] 對 表 達 式 進 行 求 值 , 與 命 令 e x p r 不 同 的 是 :[ ] 用於插值

[root@localhost ~]# echo $[100 + 200]

300[root@localhost ~]# expr 100 + 200

300[root@localhost ~]# a=100

[root@localhost ~]# b=200

[root@localhost ~]# echo $[ a + b ]

300

符號「 」的用法

和 分別用來表示求和與求積。sigma.x 將x中的值全部相加.xf xf,x表示的是產量,這個沒有錯 f表示有同樣產量x的人數,數學上稱為頻數,就是英語的frequency.xf的意思,不是人均產量 人數,而是產量x 產量為x的人數 例如,產量2的人有3個,產量4的人有5個,產量6的人有8個。總產...

C 的符號用法 ?問號用法

在字串前加 相當於對string format 的簡化 如 int m a 1 int m b 2 使用string format console.writeline string format this is a this is b m a,m b 使用了 就可以在原來佔位符的地方直接用引數代替 ...

C 符號和 符號的用法介紹

1.忽略轉義字元 string str c windows system32 string str c windows system32 2.字串跨行 string str line one line two line three line fore string str line one line...