请解释一下。 ./ab_project_setup.ksh $(pwd) 语句

发布于 2024-10-02 06:12:12 字数 76 浏览 4 评论 0原文

请解释一下这句话的含义

. ./ab_project_setup.ksh $(pwd)

Please explain the meaning of this statement

. ./ab_project_setup.ksh $(pwd)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

熟人话多 2024-10-09 06:12:12

添加 Alberto 的答案:

此处是一个小演示:

$ cat a.sh        # the script a.sh just exports a variable foo
export foo="$1"   # with it's value set to first command line argument.
$ echo $foo       # currently variable foo is not set.

$ . ./a.sh $(pwd) # source the script passing it pwd as argument.
$ echo $foo       # variable foo is now set.
/home/codaddict
$ pwd             # the present working directory.
/home/codaddict

Adding to Alberto's answer:

Here is a small demo:

$ cat a.sh        # the script a.sh just exports a variable foo
export foo="$1"   # with it's value set to first command line argument.
$ echo $foo       # currently variable foo is not set.

$ . ./a.sh $(pwd) # source the script passing it pwd as argument.
$ echo $foo       # variable foo is now set.
/home/codaddict
$ pwd             # the present working directory.
/home/codaddict
陈年往事 2024-10-09 06:12:12
.

后面的内容

./ab_project_setup.ksh

表示 source您要获取的文件名

$(pwd)

将扩展为当前工作目录并作为参数传递给脚本。

.

means source what is following

./ab_project_setup.ksh

the name of the file you are sourcing

$(pwd)

expands to the current working directory and is passed as argument to the script.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文