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




原文地址:https://www.cnblogs.com/double12gzh/p/10166246.html