- 浏览: 134752 次
- 性别:
- 来自: 成都
文章分类
最新评论
【基本介绍】
set是shell的内置命令。可以用来设置修改变量,设置变量的位置
【参数介绍】
-e当还回值非0是立即退出脚本
-o设置内置环境变量
【基本使用】
1.配置环境变量
2.设置变量参数及位置
【参考引用】
http://www.thegeekstuff.com/2010/08/bash-shell-builtin-commands/
set是shell的内置命令。可以用来设置修改变量,设置变量的位置
【参数介绍】
-e当还回值非0是立即退出脚本
-o设置内置环境变量
set [+abefhkmnptuvxBCEHPT] [+o option] [arg ...] -e Exit immediately if a pipeline (which may consist of a single simple command), a subshell command enclosed in paren- -o option-name The option-name can be one of the following: allexport Same as -a.
【基本使用】
1.配置环境变量
[root@pandaVM script]# set | head -10 BASH=/bin/bash BASHOPTS=checkwinsize:cmdhist:expand_aliases:extquote:force_fignore:hostcomplete:interactive_comments:login_shell:progcomp:promptvars:sourcepath BASH_ALIASES=() BASH_ARGC=() BASH_ARGV=() BASH_CMDS=() BASH_LINENO=() BASH_SOURCE=() BASH_VERSINFO=([0]="4" [1]="1" [2]="2" [3]="1" [4]="release" [5]="x86_64-redhat-linux-gnu") BASH_VERSION='4.1.2(1)-release' [root@pandaVM script]# set +o history # To disable the history storing. +o disables the given options. [root@pandaVM script]# set -o history -o enables the history
2.设置变量参数及位置
[root@pandaVM script]# echo $1 , $2 , [root@pandaVM script]# set `free | head -2 | tail -1` [root@pandaVM script]# echo $1 , $2 Mem: , 1012352 [root@pandaVM script]# free | head -2 | tail -1 Mem: 1012352 936836 75516 0 144684 527492
【参考引用】
http://www.thegeekstuff.com/2010/08/bash-shell-builtin-commands/
发表评论
-
linux shell - 远端修改非root密码
2015-01-09 20:40 955【基本介绍】 通过远端修改普通用户密码,而passwd --s ... -
linux shell - broken pip error
2015-01-07 15:36 2664【基本介绍】 这里我们介绍发生broken pipe错误的原因 ... -
linux locate - find files by name
2014-12-17 17:46 561【基本介绍】 这里我们介绍locate命令,用来查找文件。 ... -
linux ssh - GSSAPIAuthentication
2014-12-10 14:58 2001【基本介绍】 最近公司搬家,发现合作伙伴的服务器的用ftp工具 ... -
linux tar - 压缩解压
2014-12-01 16:04 969【基本介绍】 今天遇到要添加文件到tar文件里面,所以在这里介 ... -
linux parameter substitution - 字符串/变量处理
2014-11-17 15:56 778【基本介绍】 这里我们介绍bash里面对字符串,变量等的替换等 ... -
linux netstat - status状态描述
2014-11-14 17:59 1113【基本介绍】 这里介绍netstat命令返回的结果status ... -
linux nc - arbitrary TCP and UDP connections and listens
2014-10-31 17:46 759【基本介绍】 nc是可以打开任意端口的TCP/UDP连接和监听 ... -
linux 报错集 - Cannot retrieve metalink for repository: epel. Please verify its pat
2014-10-29 15:12 925【基本介绍】 运行yum报错Error: Cannot ret ... -
linux awk - awk tutorial
2014-10-21 10:47 458【基本介绍】 awk是一款强大的对文件内容进行处理的软件,可以 ... -
linux ps - processes
2014-10-20 14:17 1220【基本介绍】 ps - report a snapshot o ... -
linux lsof - list open files
2014-10-17 17:31 711【基本介绍】 lsof - list open files I ... -
linux - 网络连接状态
2014-10-13 11:00 1350【基本情况】 这里介绍 ... -
linux netstat - Print network connections, routing tables, interface statistics,
2014-10-13 10:37 978【基本介绍】 netstat - Print network ... -
linux vmstat - Report virtual memory statistics
2014-10-10 17:39 692【基本介绍】 vmstat - Report virtual ... -
linux yum - yum warning: rpmts_HdrFromFdno
2014-10-09 15:08 560【基本介绍】 在yum安装软件的时候有时候会报warning: ... -
Linux ip subnet mask - 网段分析
2014-09-24 19:22 1293【基本介绍】 网段的分析可以帮助我们查看两个局域地址是否可以互 ... -
linux curl - curl 上传下载
2014-09-19 11:45 2074【基本介绍】 curl is a tool to tra ... -
linux mkpasswd - 密码生成器
2014-09-18 17:18 1380【基本介绍】 作为linux admin要经常创建用户,并初始 ... -
linux dd - dd测试硬盘速度
2014-09-05 18:42 816【基本介绍】 这里我们使用dd命令来测试硬盘的读写速度 dd ...
相关推荐
前端开源库-postcss-css-variablespostcss css变量,postcss插件,用于将css自定义属性(css变量)语法转换为静态表示形式
前端开源库-postcss-variablespostss变量,postss插件,用于将变量转换为css
Laravel开发-laravel-variables Laravel项目中的变量/设置管理
安装npm install find-unused-sass-variables --save-dev用法find-unused-sass-variables folder [, folder2...] --ignore " $my -var, $my -second-var "# orfusv folder [, folder2...]API const fusv = require ...
基于纵向数据的变系数EV模型的经验似然诊断,王淑玲,郑林,本文研究了关于纵向数据的变系数EV模型的经验似然诊断问题。首先,基于经验似然方法建立了估计方程;然后,在经验似然估计的基础�
安装将插件添加到您的项目中# Install via npmnpm install --save-dev tailwind-css-variables配置CSS变量插件提供了供您使用的选项。 这是将其添加到项目Tailwind插件中的示例。 在tailwind.js或tailwind.config.js...
3rd Edition - Probability, Random Variables and Stochastic
资源分类:Python库 所属语言:Python 资源全名:traceback-with-variables-1.1.7.2.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
npm install postcss-css-variables --save-dev 目录 -- ---嵌套规则 为什么? -互操作性-与postcss-custom-properties差异 注意事项 选项 快速参考/注释 测验 变更日志 代码游乐场 在操场上尝试一下,看看您的想法...
javascript-tcg-section-2-basics-variables-data-types-operators-and-functions
@import ' node_modules/sass-mixins-variables/variables ' ; // Import Mixins @import ' node_modules/sass-mixins-variables/mixins ' ; 覆盖默认变量 mixins使用的所有变量均已设置为!default,因此可以轻松地...
05 Coding Challenge #2 - Data Types, Variables and Arrays
AI1103-Probability-and-random-variables
gulp-less-json-variables Gulp从JSON写入较少的变量 一个简单插件。 该模块写在源文件上,从JSON配置文件中指定的变量较少。 安装 最简单的方法是将gulp gulp-less-json-variables保留为package.json的...
系统环境变量(quasar-app-extension-system-environment-variables) ==== 从系统加载环境变量,并通过process.env使它们可用。 最适合在CI / CD环境中构建 在某些情况下,例如在CI环境中工作时,我们可能希望从...
$ ngx install angular-assign-root-scope-variables 不知道ngx命令行工具是什么? 了解有关更多信息。 如何使用 安装组件后: 编辑_build/assign-root-scope-variables.js 添加您的自定义逻辑 并将组件导入到...
Java Methods-Data Types, Variables, and Arithmetic.ppt
AI1103-Probability-and-Random-Variables
AI1103-PROBABILITY-AND-RANDOM-VARIABLES
AI1103-Probaility-and-Random-Variables