Bitte erkläre . ./ab_project_setup.ksh $ (pwd) statement
Frage
Bitte erläutern Sie die Bedeutung dieser Aussage
. ./ab_project_setup.ksh $(pwd)
Lösung
Zusätzlich zu Alberto 's Antwort:
Hier ist eine kleine 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
Andere Tipps
.
Mittel Quelle, was folgt
./ab_project_setup.ksh
der Name der Datei, die Sie Sourcing
$(pwd)
expandiert zum aktuellen Arbeitsverzeichnis und wird als Argument an das Skript übergeben.
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow