Shell Scripting Tutorial

Variables in the Bourne shell do not have to be declared, as they do in languages like C.
But if you try to read an undeclared variable, the result is the empty string.

In order to receive environment changes back from the script, we must source the script - this effectively runs the script within our own interactive shell, instead of spawning another shell to run it.
. ./my.sh (.space./my.sh)

touch "${USER_NAME}_file"

The "." dot before the name of the library.sh is not a typo; it tells the calling shell not to spawn another shell for library.sh, so that its functions (and variables) become available to the calling shell.

Reference for keywords that are not search engine friendly

Shell Scripting 笔记的更多相关文章

  1. Linux Shell Scripting Cookbook 读书笔记 1

    本系列文章为<Linux Shell Scripting Cookbook>的读书笔记,只记录了我觉得工作中有用,而我还不是很熟练的命令 书是很好的书,有许多命令由于我比较熟悉,可能就没有 ...

  2. Learning The Bash Shell读书笔记(整理)

    最近搞了一本书 Learning Bash Shell,发现有人已经写了阅读笔记,我就在这边整理一下 来自blog:http://blog.sina.com.cn/n4mine Learning Th ...

  3. SHELL学习笔记----IF条件判断,判断条件

    SHELL学习笔记----IF条件判断,判断条件 前言: 无论什么编程语言都离不开条件判断.SHELL也不例外.  if list then           do something here   ...

  4. Shell编程笔记

    Shell编程笔记与Windows下熟悉的批处理类似,也可以将一些重复性的命令操作写成一个脚本方便处理.   修改别人的脚本,运行后遇到个问题 setenv: command not found 查证 ...

  5. Expert Shell Scripting

    Expert Shell Scripting 好好学习这本书

  6. shell学习笔记

    shell学习笔记 .查看/etc/shells,看看有几个可用的Shell . 曾经用过的命令存在.bash_history中,但是~/.bash_history记录的是前一次登录前记录的所有指令, ...

  7. Shell脚本笔记

      如何查询文件里的某个字符串? grep “字符串” 文件 例:grep "abc" tmp.txt   如何将查询出来的内容赋给变量? str=$(grep "abc ...

  8. 菜鸟教程之学习Shell script笔记(上)

    菜鸟教程之学习Shell script笔记 以下内容是,学习菜鸟shell教程整理的笔记 菜鸟教程之shell教程:http://www.runoob.com/linux/linux-shell.ht ...

  9. [转帖][Bash Shell] Shell学习笔记

    [Bash Shell] Shell学习笔记 http://www.cnblogs.com/maybe2030/p/5022595.html  阅读目录 编译型语言 解释型语言 5.1 作为可执行程序 ...

随机推荐

  1. C# .Net 委托和事件的区别

    在.net中,事件是一种特殊的委托,那他到底特殊在哪,换句话说,加上event关键字到底有什么用,我理解主要有两方面,下面用实例说明: 一 .事件只能在本类型内部“触发”,委托不管在本类型内部还是外部 ...

  2. python之ddt模块使用

    一.DDT(数据驱动)简介 Data-Driven Tests(DDT)即数据驱动测试,可以实现不同数据运行同一个测试用例(通过数据的不同来驱动测试结果的不同). ddt本质其实就是装饰器,一组数据一 ...

  3. oracle之二表的几种类型

    Oracle中表的几种类型 1.表的功能:存储.管理数据的基本单元(二维表:有行和列组成)2.表的类型: 1)堆表:heap table :数据存储时,行是无序的,对它的访问采用全表扫描. 2)分区表 ...

  4. swift基本体验

    Swift初体验 1. 导入框架 2. 定义标识符: let/var 3. 语句结束时;可以省略 4. print() 5. let/var 6. 逻辑分支 7. 循环使用 // 1.Swift中如何 ...

  5. defer implement for C/C++ using GCC/Clang extension

    前述: go 中defer 给出了一种,延时调用的方式来释放资源.但是对于C/C++去没有内置的这种属性.对于经常手动管理内存的C/C++有其是C程序员这种特性显得无比重要.这里给出了一种基于GCC/ ...

  6. CentOS 7使用PuppeteerSharp无头浏览器注意事项

    环境: CentOS 7.6.1810 .net core 3.1 PuppeteerSharp 2.0.0 1.如网络部稳定可以提前下载需要的chromium 下载地址:https://storag ...

  7. python实例文本进度条

    简单的文本进度条代码 解析 引入time库 打印一行作为开始 最后也打印一个结束的标签 定义变量等于10,文本进度条大概的宽度是10 使用for循环来模拟进度,for i in range()能够不断 ...

  8. Java程序员必备基础:JDK 5-15都有哪些经典新特性

    前言 JDK 15发布啦~ 我们一起回顾JDK 5-15 的新特性吧,大家一起学习哈~ 本文已经收录到github ❝ https://github.com/whx123/JavaHome ❞ 「公众 ...

  9. maximo入门---开发者提要

    1.添加控件 在一个程序设计器里添加控件,控件必须要和这个程序对象(这个程序关联的表)的一个属性绑定 ps maximo挺高级的,比如一个date类型的输入框,会自动给他补上时间控件 2.复制程序 复 ...

  10. springboot之零碎小知识

    1.springboot启动类加载yml配置项 主要是如下方法,读取了yml的配置项,赋值为类成员属性 @Autowired public void setEnvironment(Environmen ...