zoukankan      html  css  js  c++  java
  • Shell good example

    (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

  • 相关阅读:
    E
    D
    C
    B
    Python
    IDEA 设置资源目录
    光猫指示灯含义
    IO模型
    Linux 总目录
    Linux python 使用
  • 原文地址:https://www.cnblogs.com/Berryxiong/p/5627492.html
Copyright © 2011-2022 走看看