-1
使用變量我有以下腳本:我怎樣才能CD在bash
#!/bin/bash
set -o errexit # Exit on error
# Enable script to run from anywhere
root="$(dirname ${BASH_SOURCE[0]})"
cd "$($root)"
source ./scripts/main
cd "$($root)"
pwd
source ./scripts/test
cd "$($root)/applicant"
yarn build
但我得到這個錯誤:
./build.sh: line 8: .: filename argument required
我怎樣才能得到當前目錄的變量?