Domanda

Si prega di spiegare il significato di questa affermazione

. ./ab_project_setup.ksh $(pwd)
È stato utile?

Soluzione

In aggiunta al Alberto 's rispondere:

Ecco una piccola 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

Altri suggerimenti

.

mezzi fonte ciò che sta seguendo

./ab_project_setup.ksh

il nome del file che si sono sourcing

$(pwd)

si espande per la directory di lavoro corrente e viene passato come argomento per lo script.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top