1
我的bash的版本是:爲什麼我的bash版本不接受函數關鍵字?
bash --version
GNU bash, version 4.2.45(1)-release (x86_64-pc-linux-gnu)
如果我做的原型功能
#!/bin/bash
function f()
{
echo "hello" $1
}
f "world"
我得到Syntax error: "(" unexpected
這是爲什麼?禁用了javascript的
輸出是:
autocd off
cdable_vars off
cdspell off
checkhash off
checkjobs off
checkwinsize on
cmdhist on
compat31 off
compat32 off
compat40 off
compat41 off
direxpand off
dirspell off
dotglob off
execfail off
expand_aliases on
extdebug off
extglob on
extquote on
failglob off
force_fignore on
globstar off
gnu_errfmt off
histappend on
histreedit off
histverify off
hostcomplete off
huponexit off
interactive_comments on
lastpipe off
lithist off
login_shell off
mailwarn off
no_empty_cmd_completion off
nocaseglob off
nocasematch off
nullglob off
progcomp on
promptvars on
restricted_shell off
shift_verbose off
sourcepath on
xpg_echo off
作品我..確保沒有特殊,隱藏,文件中的字符 – hek2mgl
奇怪。有關如何查找這些角色的任何提示? – fpghost
試試'cat -A filename'。它將控制字符擴展爲可打印的形式,並在每行的末尾添加一個「$」。 –