ballball大佬们了,
为什么加起来和是256它输出却是0啊?而且每256一循环!
还有还有,
第二张图中参数访问越界之后得到的数到底是啥呀?
磕头了砰砰砰
我只有20分了,拿走拿走全都拿走555

解决方案 »

  1.   

    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.
      

  2.   

    谢谢,不过这种意思就是bash/sh没法返回256以外的数据之和吗?
      

  3.   


    #!/bin/bashsum() {
            echo $(($1 + $2))
    }echo "input the first number:"
    read n1
    echo "input the second number:"
    read n2res=$(sum $n1 $n2)
    echo "$n1 + $n2 = $res"