

ballball大佬們了,
為什么加起來和是256它輸出卻是0啊?而且每256一回圈!
還有還有,
第二張圖中引數訪問越界之后得到的數到底是啥呀?
磕頭了砰砰砰
我只有20分了,拿走拿走全都拿走555
uj5u.com熱心網友回復:
有沒有人能撈我一把啊啊uj5u.com熱心網友回復:
bash/sh的退出碼(EXIT STATUS)在0-255之間,EXIT STATUS
The exit status of an executed command is the value returned by the waitpid system call or equivalent function. Exit statuses fall between 0 and
The environment for any simple command or function may be augmented temporarily by prefixing it with parameter assignments, as described above in
PARAMETERS. These assignment statements affect only the environment seen by that command.
If the -k option is set (see the set builtin command below), then all parameter assignments are placed in the environment for a command, not just
those that precede the command name.
When bash invokes an external command, the variable _ is set to the full file name of the command and passed to that command in its environment.
uj5u.com熱心網友回復:
謝謝,不過這種意思就是bash/sh沒法回傳256以外的資料之和嗎?
uj5u.com熱心網友回復:
#!/bin/bash
sum() {
echo $(($1 + $2))
}
echo "input the first number:"
read n1
echo "input the second number:"
read n2
res=$(sum $n1 $n2)
echo "$n1 + $n2 = $res"
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/80358.html
標籤:應用程序開發區
上一篇:ssh被別人遠程控制
