shell中的函数参数


  #!/bin/bash
  
  func_1()
  {
  
          echo $1
  }
  
  str="jeguan hello" //注意引号在这里的作用
  func_1 "$str"
 
  echo "please pay attention to the missed \"\""
  func_1 $str       //不带引号的时候

运行结果:

jeguan hello
please pay attention to the missed ""
jeguan




posted @ 2015-07-05 13:26  大海星  阅读(402)  评论(0编辑  收藏  举报