-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
我怎样才能得到当前目录的变量?