문제

Please explain the meaning of this statement

. ./ab_project_setup.ksh $(pwd)
도움이 되었습니까?

해결책

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

다른 팁

.

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top