基础命令学习目录首页

功能说明:unset是一个内建的Unix
shell命令,在Bourne shell家族(sh、ksh、bash等)和C shell家族(csh、tcsh等)都有实现。它可以取消设置一个shell变量,从内存和shell的导出环境中删除它。它实现为一个壳层内建指令,因为它直接操纵shell的内部。
只读shell变量不能被unset。如果试图unset只读变量,unset命令将打印一个错误消息,并返回一个非零的退出代码。
This command removes one or more variables. Each name is a variable name, specified in any of the ways acceptable to the
set command. If a name refers to an element of an array then that element is removed without affecting the rest of the array. If a
name consists of an array name with no parenthesized index, then the entire array is deleted. The
unset command returns an empty string as result. An error occurs if any of the variables doesn't exist, and any variables after the non-existent one are not deleted.
语  法:
unset [-fv][变量或函数名称]补充说明:unset为shell内建指令,可删除变量或函数。参   数:
  -f  仅删除函数。
  -v  仅删除变量。
[3][root][test:/home/root/Desktop] set lx = "ls -lh"
[3][root][test:/home/root/Desktop] $lx
total 80K
drwxrwxr-x  2 root tt 4.0K 2014-02-19 09:32 bin
drwxrwxr-x  3 root tt 4.0K 2014-02-10 10:56 Data
drwxrwxr-x  2 root tt 4.0K 2014-02-19 09:32 lib
drwxrwxr-x 10 root tt 4.0K 2014-02-20 16:12 script
-r--r--r--  1 root tt  312 2014-02-19 09:32 sut.cs
[3][root][test:/home/root/Desktop]
[3][root][test:/home/root/Desktop]
[3][root][test:/home/root/Desktop] set
......此处省略输出
[3][root][test:/home/root/Desktop] set |grep -i lx
lx ls -lh
[3][root][test:/home/root/Desktop]
[3][root][test:/home/root/Desktop] unset lx
[3][root][test:/home/root/Desktop] set | grep -i lx
---------------------
作者:惹不起的程咬金
来源:CSDN
原文:https://blog.csdn.net/carolzhang8406/article/details/21246145
版权声明:本文为博主原创文章,转载请附上博文链接!

unset命令详解的更多相关文章

  1. samtools常用命令详解(转)

    转自:samtools常用命令详解 samtools的说明文档:http://samtools.sourceforge.net/samtools.shtml samtools是一个用于操作sam和ba ...

  2. CentOS下yum命令详解

    CentOS下yum命令详解 Yum: 即Yellowdog Update Modifier,是一种基于rpm的包管理工具 yum命令使用示例 显示yum仓库 显示所有仓库 yum repolist ...

  3. Git初探--笔记整理和Git命令详解

    几个重要的概念 首先先明确几个概念: WorkPlace : 工作区 Index: 暂存区 Repository: 本地仓库/版本库 Remote: 远程仓库 当在Remote(如Github)上面c ...

  4. linux yum命令详解

    yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...

  5. Linux下ps命令详解 Linux下ps命令的详细使用方法

    http://www.jb51.net/LINUXjishu/56578.html Linux下的ps命令比较常用 Linux下ps命令详解Linux上进程有5种状态:1. 运行(正在运行或在运行队列 ...

  6. Docker命令详解

    Docker命令详解   最近学习Docker,将docker所有命令实验了一番,特整理如下: # docker --help Usage: docker [OPTIONS] COMMAND [arg ...

  7. linux awk命令详解

    linux awk命令详解 简介 awk是一个强大的文本分析工具,相对于grep的查找,sed的编辑,awk在其对数据分析并生成报告时,显得尤为强大.简单来说awk就是把文件逐行的读入,以空格为默认分 ...

  8. android adb 命令详解

    ADB (Android Debug Bridge)  是android SDK中的工具,需要先配置环境变量才能使用.起调试桥的作用,可以管理安卓设备.(也叫debug工具) ---------查看设 ...

  9. Git 常用命令详解

    Git 是一个很强大的分布式版本管理工具,它不但适用于管理大型开源软件的源代码(如:linux kernel),管理私人的文档和源代码也有很多优势(如:wsi-lgame-pro) Git 的更多介绍 ...

随机推荐

  1. active developer path ("/Applications/Xcode.app/Contents/Developer")

    -> git xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer" ...

  2. Mysql基础知识—索引

    公司最近开始尝试进行改革,如何活跃团队气氛.开发就给我们说了一些算是科普类的数据库知识,下面参杂自己的理解,方便自己后续翻看.   1.什么是索引 索引在MySQL中也叫做“键”,是存储引擎用于快速找 ...

  3. HDU 1715 (大数相加,斐波拉契数列)

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1715 大菲波数 Time Limit: 1000/1000 MS (Java/Others)     ...

  4. C#只能lock 引用类型的值 (转载)

    Lock:        C#只能lock 引用类型的值,如果lock一个int, bool,编译器会报错.    当一个互斥锁已被占用时,在同一线程中执行的代码仍可以获取和释放该锁.但是,在其他线程 ...

  5. 图片 和 base64 互转

    图片转base64 NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlStr]]; UIImage *img = ...

  6. mysql命令框中向表中插入中文字符,在可视化工具MySQL Workbeach或phpMyAdmin中不显示或显示乱码的问题解决

     一.问题导出 在刚刚开始学习MySQL数据库应用与开发这门课程的时候,老师建议我们使用可视化工具MySQL Workbeach进行数据库的相关管理,但是小编在mysql命令框使用insert命令向表 ...

  7. 更新Android Studio 3.1.1碰到的问题

    碰到了如下问题 The SourceSet 'instrumentTest' is not recognized by the Android Gradle Plugin. Perhaps you m ...

  8. WPF开发学习笔记

    1.命名规范: 插件名称统一以:CI.Client.Plugins.SYS.+TableName   eg:CI.Client.Plugins.SYS.EnterPrise 2.插件文件目录: 3.D ...

  9. 2017-2018-2 《网络对抗技术》 20155322 第五周 Exp2 后门原理与实践

    #2017-2018-2 <网络对抗技术> 20155322 第五周 Exp2 后门原理与实践 [博客目录] 1-实践目标 1.1-实践介绍 1.2-实践内容 1.3-实践要求 2-实践过 ...

  10. logistic softmax

    sigmoid函数(也叫逻辑斯谛函数):  引用wiki百科的定义: A logistic function or logistic curve is a common “S” shape (sigm ...