操作系统: macOS塞拉v10.12.2
我试图让R在命令行中工作,结果遇到了这个问题,可能是因为我对编码比较陌生,并且搞砸了一些我不应该做的事情。
打开新终端时:
-bash: /Users/Brad/.bash_profile: line 33: syntax error: unexpected end of file
当我检查这个配置文件时,它看起来是这样的:
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks
我有两个脚本可以让CPU达到峰值。
infinite_loop.bash:
#!/bin/bash
while [ 1 ] ; do
# Force some computation even if it is useless to actually work the CPU
echo $((13**99)) 1>/dev/null 2>&1
done
cpu_spike.bash:
#!/bin/bash
# Either use environment variables for NUM_CPU and DURATION, or define them
有人能解释一下这个bash脚本是如何工作的吗?我不明白的部分是""":",这个语法在bash中意味着什么?
#!/bin/sh
""":"
echo called by bash
exec python $0 ${1+"$@"}
"""
import sys
print 'called by python, args:',sys.argv[1:]
测试运行结果:
$ ./callself.sh xx
called by bash
called by python,
我想使用带有Sublime Text的SiblimeREPL包。当我尝试创建一个REPL时,我得到
SublimeREPL: obtaining sane environment failed in getenv()
Check console and 'getenv_command' setting
WARN: Falling back to SublimeText environment
无论我尝试启动哪个REPL,都会发生这种情况。(我尝试过Ruby、Python和Clojure。)我尝试了Sublime Text 2和Sublime Text 3,结果相同。这是在Mac
源代码:
#!/bin/bash
echo "Parametro is $1"
if [ $1 -gt 9 ]
then
echo "entre al if";
fi
echo"Fin del script";
我的bash文件有执行权限:
-rwxrwxr-x 1 mzadmin mzadmin 108 Feb 15 13:07 test.sh
我按如下方式运行我的bash文件:
bash test.sh 9
输出结果为:
Parametro is 9
test.sh: line 8: syntax error: unexpe