Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
终端回显bash中定义的函数
Experiences and Insight
922
views ·
3
replies ·
To
floor
Go
sparkbjfu
deepin
2015-01-21 17:21
Author
在bashrc中定义了一个函数,但是在启动终端时定义函数的代码会显示的终端上,同样的代码在CAELinux上测试了,不会回显
另外发现,在bash中写if [ "a" == "a" ] 会报错,改成if [ "a" = "a" ]才行
求问,这是什么情况呢
Reply
Like 0
Favorite
View the author
All Replies
sparkbjfu
deepin
2015-01-21 17:23
#1
bash中定义的函数代码是
myfun() { echo "test fun" ; }
Reply
Like 0
View the author
electricface
deepin
2015-01-21 17:38
#2
我也写了,没有回显啊
Reply
Like 0
View the author
sparkbjfu
deepin
2015-01-21 19:03
#3
我也写了,没有回显啊
你再下面加一句
export -f myfun
试下呢?
另外,如果不加这句,和加了,有什么使用上的不同??
Reply
Like 0
View the author
Please
sign
in first
Featured Collection
Change
[Tutorial] deepin25 WSL Offline Installation Guide
UOS AI 2.8 Released! Three New Intelligent Agents & Major Evolution
Solid Q&A | deepin 25 Common Questions – The Immutable System Edition
New Thread
Popular Ranking
Change
The settings menu needs to be translated into Russian.
the Network section no longer appears
Error during system installation
Deepin IDE?
Deepin Native Apps not launching in the latest version
Music player with sample rate and bit depth
Popular Events
More
另外发现,在bash中写if [ "a" == "a" ] 会报错,改成if [ "a" = "a" ]才行
求问,这是什么情况呢