我不是bash腳本編寫的專家,但我真的不明白這裏的內容。我的腳本是這樣的:將自變量傳遞給bash腳本時出現奇怪的錯誤
#!/usr/bin/env bash
echo "calling asetup"
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh
asetup 17.6.0,slc5
echo "Now running..."
echo "argument [email protected]"
我爲./myscript -v
調用它,輸出爲:
calling asetup
atlasLocalSetup.sh: invalid option -- 'v'
'atlasLocalSetup.sh --help' for more information
./prova.sh: line 12: asetup: command not found
Now running...
argument -v
在第二行,什麼是atlasLocalSetup.sh: invalid option -- 'v'
?爲什麼atlasLocalSetup.sh
使用-v
選項進行調用?