如何将命令行参数传递给函数。范围错误?

时间:2019-06-12 17:33:38

标签: bash

如何将命令行参数传递给bash函数?

代码:

#/bin/bash

arg = "$1"

display_success() {
  echo -e "\nSuccessfully created new response chart for the $1 client."
  sleep 1
  echo -e "Set up Firebase Production environment.\n"
}

display_success "$arg"

我不断得到

的结果
Successfully created new response chart for the  client.

注意空格。

0 个答案:

没有答案