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. 如何将tensorflow1.x代码改写为pytorch代码(以图注意力网络(GAT)为例)

    之前讲解了图注意力网络的官方tensorflow版的实现,由于自己更了解pytorch,所以打算将其改写为pytorch版本的. 对于图注意力网络还不了解的可以先去看看tensorflow版本的代码, ...

  2. 关于while (~scanf("%d %d", &m, &n))的用法

    其功能是循环从输入流读入m和n,直到遇到EOF,有如下关系: while (~scanf("%d %d", &m, &n)) ↔ while (scanf(&quo ...

  3. 云计算openstack核心组件——neutron网络服务(8)

    一.neutron 介绍:   Neutron 概述 传统的网络管理方式很大程度上依赖于管理员手工配置和维护各种网络硬件设备:而云环境下的网络已经变得非常复杂,特别是在多租户场景里,用户随时都可能需要 ...

  4. 11.深入k8s:kubelet工作原理及源码分析

    转载请声明出处哦~,本篇文章发布于luozhiyun的博客:https://www.luozhiyun.com 源码版本是1.19 kubelet信息量是很大的,通过我这一篇文章肯定是讲不全的,大家可 ...

  5. Win10使用VMWare15安装Ubuntu-18.04.2-desktop-amd64

    本文在Win10系统中使用VMWare Workstation Pro 15.1.0虚拟机安装Ubuntu-18.04.2-desktop-amd64.iso系统,同时安装VMWare Tools(实 ...

  6. UCanCode发布升级E-Form++可视化源码组件库2020全新版 !

    2020年. 中国.成都 UCanCode发布升级E-Form++可视化源码组件库2020全新版 ! --- 全面性能提升,UCanCode有史以来最强大的版本发布! E-Form++可视化源码组件库 ...

  7. 进程管理、PS命令、nohup命令

    1. Windows 下,扩展名为exe的文件,鼠标双击,运行,把这个程序正在运行的实例,称之为进程 Windows进程的信息可以通过 任务管理器看到 查看到:正在运行的计算器程序 Calculato ...

  8. 原创-公司项目部署交付环境预检查shell脚本

    大型项目环境预检查脚本,根据自己实际情况修改脚本中变量,给大家一个思路~ #!/usr/bin/env bash root=$( cd $(dirname $0) pwd ) source " ...

  9. C++雾中风景15:聊聊让人抓狂的Name Mangling

    Name Mangling,直接翻译过来为名字改写 .它是深入理解 C++ 编译链接模型的必由之路. 笔者近期进行数据库开发工作时,涉及到MySQL客户端的编译链接的问题,通过重新厘清了之前理解一知半 ...

  10. PHP图片压缩类,高清无损直接用就ok啦

    这个不完全是我自己写的-_-!,但是好用呀 <?php /** * Created by PhpStorm. * Note:文件介绍 * User: Lynly * Date: 2018/11/ ...