我正在关注本教程https://www.youtube.com/watch?v=8rjRfW4JM2I 我已经完成了这个No such file or directory error when configuring aws on cygwin
但在我之后我仍然得到错误 do $ export $ PATH ='cat foo'
-bash:export:
/usr/local/bin:/usr/bin:/cygdrive/c/ProgramData/Oracle/Java/javapath:/cygdrive/c/windows/system32:/cygdrive/c/windows:/cygdrive/c/windows/System32/Wbem:/cygdrive/c/windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program': not a valid identifier
-bash: export: `Files/TortoiseSVN/bin:/cygdrive/c/Program': not a valid identifier
-bash: export: `(x86)/Windows': not a valid identifier
-bash: export: `Kits/10/Windows': not a valid identifier
-bash: export: `Toolkit:/cygdrive/c/Program': not a valid identifier
-bash: export: `Files/Microsoft': not a valid identifier
-bash: export: `Server/130/Tools/Binn:/cygdrive/c/Users/aman.dalmia/AppData/Local/Programs/Python/Python27:/cygdrive/c/Users/aman.dalmia/AppData/Local/Programs/Python/Python27/Scripts:/cygdrive/c/Program': not a valid identifier
-bash: export: `Files/PuTTY:/cygdrive/c/Program': not a valid identifier
-bash: export: `Files/Microsoft': not a valid identifier
-bash: export: `Server/120/Tools/Binn:/cygdrive/c/Program': not a valid identifier
-bash: export: `Files/nodejs:/cygdrive/c/Program': not a valid identifier
-bash: export: `Files/Git/cmd:/cygdrive/c/Program': not a valid identifier
-bash: export: `Files/Microsoft': not a valid identifier
-bash: export: `Server/Client': not a valid identifier
-bash: export: `SDK/ODBC/110/Tools/Binn:/cygdrive/c/Program': not a valid identifier
-bash: export: `(x86)/Microsoft': not a valid identifier
-bash: export: `Server/120/Tools/Binn:/cygdrive/c/Program': not a valid identifier
-bash: export: `Files/Microsoft': not a valid identifier
-bash: export: `Server/120/DTS/Binn:/cygdrive/c/Program': not a valid identifier
-bash: export: `(x86)/Microsoft': not a valid identifier
-bash: export: `Server/120/Tools/Binn/ManagementStudio:/cygdrive/c/Program': not a valid identifier
-bash: export: `(x86)/Microsoft': not a valid identifier
-bash: export: `Server/120/DTS/Binn:/cygdrive/c/Program': not a valid identifier
-bash: export: `Files/TortoiseGit/bin:/cygdrive/c/Users/aman.dalmia/AppData/Roaming/npm:/cygdrive/d/Installs/Maven/bin:': not a valid identifier
-bash: export: `D:/Tesseract-OCR:/cygdrive/c/Users/aman.dalmia/AppData/Local/Programs/Python/Python27/Scripts:/cygdrive/c/Users/aman.dalmia/AppData/Local/Programs/Python/Python27': not a valid identifier
-bash: export: `=': not a valid identifier
-bash: export: `cat foo': not a valid identifier
答案 0 :(得分:1)
你写了
export $PATH = 'cat foo'
你需要
export PATH=`cat foo`
使用$PATH
,您尝试导出PATH的值,但是要导出PATH变量。
=
周围有空格。我喜欢那些试图让他们的代码可读的人,但是通过作业,这些空间是被禁止的
请注意,您必须在if [ "${somevar}" = "example" ]
中使用空格
您正尝试在子shell中执行cat foo
。你需要支持,而不是正常的报价。