我不是 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 $@"
我用 as 调用它./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
?