终端回显bash中定义的函数
Tofloor
poster avatar
sparkbjfu
deepin
2015-01-21 17:21
Author
在bashrc中定义了一个函数,但是在启动终端时定义函数的代码会显示的终端上,同样的代码在CAELinux上测试了,不会回显
另外发现,在bash中写if [ "a" == "a" ] 会报错,改成if [ "a" = "a" ]才行

求问,这是什么情况呢
Reply Favorite View the author
All Replies
sparkbjfu
deepin
2015-01-21 17:23
#1
bash中定义的函数代码是
myfun() { echo "test fun" ; }
Reply View the author
electricface
deepin
2015-01-21 17:38
#2
我也写了,没有回显啊
Reply View the author
sparkbjfu
deepin
2015-01-21 19:03
#3
我也写了,没有回显啊

你再下面加一句
export -f myfun
试下呢?
另外,如果不加这句,和加了,有什么使用上的不同??
Reply View the author