clear out all variables without closing terminal

https://unix.stackexchange.com/questions/172655/clear-out-all-variables-without-closing-terminal

I want to know how to clear all variables which I defined in command prompt without closingterminal ?

for example, if I set a variable in command prompt as:

$ a=1

now I want to delete the variable $a (and many other variables defined in similar way) without closing terminal. I could use unset but it will be hectic if there are large no. of variables

---------------------------

If you do

exec bash

you will use a fresh & new environnement

--------------------------------------------------

https://stackoverflow.com/questions/15825353/bash-array-export

You can't export an array in Bash (or any other shell). Bash will never export an array to the environment (until maybe implemented someday, see the bugs section in the manpage).

There are a couple things going on here. Again, setting the -x attribute on an array is nonsensical because it won't actually be exported. The only reason you're seeing those results is because you defined the array before localizing it, causing it to drop down to the next-outermost scope in which that name has been made local (or the global scope).

So to be clear, whenever you use a declaration command, you're always creating a local except when you use export or readonly with a non-array assignment as an argument, because these are POSIX, which doesn't specify either locals or arrays.

clear out all variables without closing terminal的更多相关文章

  1. 串口通信编程向导 Serial Programming Guide for POSIX Operating Systems

    https://www.cmrr.umn.edu/~strupp/serial.html#CONTENTS Introduction Chapter 1, Basics of Serial Commu ...

  2. Applying vector median filter on RGB image based on matlab

    前言: 最近想看看矢量中值滤波(Vector median filter, VMF)在GRB图像上的滤波效果,意外的是找了一大圈却发现网上没有现成的code,所以通过matab亲自实现了一个,需要学习 ...

  3. ThreadPoolExecutor源码学习(2)-- 在thrift中的应用

    thrift作为一个从底到上除去业务逻辑代码,可以生成多种语言客户端以及服务器代码,涵盖了网络,IO,进程,线程管理的框架,着实庞大,不过它层次清晰,4层每层解决不同的问题,可以按需取用,相当方便. ...

  4. 基于Mono.Cecil的静态注入

    Aop注入有2种方式:动态注入和静态注入,其中动态注入有很多实现了 动态注入有几种方式: 利用Remoting的ContextBoundObject或MarshalByRefObject. 动态代理( ...

  5. Android & CM build basics

    [CM source code folders] bootable/Among other things, the source for ClockworkMod recovery is in her ...

  6. SQLServer temporary table and table variable

    Temporary tables are created in tempdb.  The name "temporary" is slightly misleading, for ...

  7. Octave入门

    Octave/Matlab Tutorial Octave/Matlab Tutorial Basic Operations 你现在已经掌握不少机器学习知识了 在这段视频中 我将教你一种编程语言 Oc ...

  8. matlab安装和入门

    下载iso镜像: ISO镜像下载地址链接: http://pan.baidu.com/s/1i31bu5J 密码: obo1 单独破解文件下载链接: http://pan.baidu.com/s/1c ...

  9. Android NDK开发指南---Application.mk文件和android.mk文件

    https://android.googlesource.com/platform/development/+/donut-release/ndk/docs/OVERVIEW.TXT https:// ...

随机推荐

  1. Eclipse 添加 YAML插件

    官网:https://github.com/oyse/yedit 离线版本:(链接: https://pan.baidu.com/s/1PJzkS1tI-VigZvfbYXUh9A 密码: gfep) ...

  2. python自动化测试学习笔记-4内置函数,处理json

    函数.全局变量 写代码时注意的几点事项: 1.一般写代码的时候尽量少用或不用全局变量,首先全局变量不安全,大家协作的情况下,代码公用容易被篡改,其次全局变量会一直占用系统内容. 2.函数里如果有多个r ...

  3. eclipse上ndk环境的搭建&&so文件的生成&&jni文件的调用

    JNI是java语言提供的Java和C/C++相互沟通的机制,Java可以通过JNI调用本地的C/C++代码,本地的C/C++的代码也可以调用java代码.JNI 是本地编程接口,Java和C/C++ ...

  4. 安装office1406错误!!!急死个人。。。。。

    因为用到Microsoft.Office.Interop.Word,将word转PDF.所以在服务器上需要安装office,但是报错1406,不能将值插入注册表..... 然后百度各种问题,说需要将注 ...

  5. cplusplus系列>utility>pair

    http://www.cplusplus.com/reference/utility/pair/ 用于存储一对异构对象 // Compile: g++ -std=c++11 pair.cpp #inc ...

  6. React Native应用实现步骤

    React Native应用实现步骤 在整个应用设计中,始终按照自下而上的原则进行.在大型的项目中,自下而上的设计方式简单,可以并行工作,并且可以在构建的同时写测试用例. React Native设计 ...

  7. 2017-5新版ionic3.1 新命令及一些常用命令

    ionic3.1的新命令: # ionic cordova --help //== 查看命令 # ionic cordova resources // 其中 icon.png (1024*1024) ...

  8. JS——offset

    1.offsetWidth.offsetHeight返回盒子宽度和高度,包括padding与border,不包括margin 2.offsetLeft.offsetTop返回盒子距离定位盒子的x轴方向 ...

  9. Win32编程笔记

    我都决定了目前不再接触这些个浪费精力的API了,结果为了DirectX编程我特么又回来了.....微软你的东西真是坑人 以前用这玩意的时候需要什么就查,查完就忘了,这次记一记,以后再用也不至于忘的太离 ...

  10. Lazarus Reading XML- with TXMLDocument and TDOMNode

    这里读取'HistoryPath' ,'TracePath' 元素下的‘value’属性使用的是 var xmlCfg: TXMLDocument; .... function ReadXMLCFG: ...