(1) Source code

#! /bin/bash

reference ()
     {
     pa=\$"$1"
     echo $pa
     x=`eval "expr $pa "`
     echo $1=$x
     local aaa=$x
     bbb=$x
     eval "$1='test been modified'"
     return 1
     }

    param="test"
    echo $param " is test"

    reference param
    return_value=$?
    echo "return value is " $return_value
    echo $param " is not test"

    return_value=$?
    echo "return value is " $return_value

    echo "aaa = "$aaa
    echo "bbb = "$bbb

(2)###############OUT PUT ###############

root@sct-x42-05:/export/home/she_file# ./reference.ksh
test  is test
$param
param=test
return value is  1
test been modified  is not test
return value is  0
aaa =
bbb = test

 

相关文章:

  • 2021-06-01
  • 2022-02-23
  • 2021-07-13
  • 2021-12-08
  • 2021-07-11
  • 2021-11-19
  • 2022-02-08
  • 2022-01-09
猜你喜欢
  • 2021-07-04
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
相关资源
相似解决方案