免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1889 | 回复: 3
打印 上一主题 下一主题

怎么取消自定义shell函数? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-07-02 15:10 |只看该作者 |倒序浏览
  1. tester@debian:/$ tester
  2. tester: command not found
  3. tester@debian:/$ function tester { echo 'hello'; }
  4. tester@debian:/$ tester
  5. hello
  6. tester@debian:/$
复制代码
测试代码如上,不知道怎么可以取消tester函数呢?就是当我输入tester时重回显示tester: command not found

shell.jpg (10.83 KB, 下载次数: 0)

shell.jpg

论坛徽章:
0
2 [报告]
发表于 2010-07-02 15:20 |只看该作者
unset tester

论坛徽章:
0
3 [报告]
发表于 2010-07-02 15:21 |只看该作者
  1. [oracle@s12071 ~]$ tester
  2. -bash: tester: command not found
  3. [oracle@s12071 ~]$ function tester { echo 'hello'; }
  4. [oracle@s12071 ~]$ tester
  5. hello
  6. [oracle@s12071 ~]$ unset tester
  7. [oracle@s12071 ~]$ tester
  8. -bash: tester: command not found
  9. [oracle@s12071 ~]$
复制代码

论坛徽章:
0
4 [报告]
发表于 2010-07-02 15:23 |只看该作者
谢谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP