shell脚本学习总结10--系统函数调用
1.打印出彩色的格式
[root@new sbin]# cat demo.sh
#/bin/bash
. /etc/init.d/functions
read -p "Pleas input your anwser[yes/no]: " an
if [[ $an = yes ]]
then
action "The answer is true" /bin/true
else
action "Then answer is false" /bin/false
fi
输出:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAvUAAACBCAIAAADPDNIkAAAVd0lEQVR4nO2dudHkOBJG4cW4MDEqpbFghdZbothKe0FlDJmAGSvTlLJjV+CVODN5Fln1XrTwdxEEMhOIwldAknAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKtP414dt3G7OOyXSb3U3XP89F59xo+ev16rvmuErH4B1a58mcEgcAAHgeTdfXZ/TWL7OF/PtBtP7j9Y1zzrnWn9A7Xf+4Hj8lDgAA8Cg0fRNdfuTUYdY3F9D1QwBbf7ySQt8MPHKQAgB8GGLv5y2TcF3fJFcfOXVcpW9EX5aCNMmaZtI5B7ePvnEPHaQAAB9G60vCZp4tfSv/F31zS3306rtKNUmB4Ep+Zm79fMuU2SAKjB/1Xefl/XUTpLNTlfLDbck+oZfe99KMUd+0gZXFKCatWt2UlRXm12bn8k3VTdf6V+99bzLS1IRvM/qm1JtTtk6/jJN0yOTc2GnkSXEAAIBdlPWNc25cQPF++Y6WE2Prw+/upC61gLZ+M618zIkpTTzdDTPNUkOcwZKktEQ2ZJtPWqkTi4WuD6e01g+z7lxmmHgzbhejobkZl03NN6hJBc3NqYm5zOpsomaocjKp9a9X38uuMPTmaJII2CDqgjvqY1Lh/DgAAMBuDPqmcD07F8vvfrVAsZAs7VsnVEhO34QfNJ38Ma3Kl+VvIQu0nGfFp9z1WEiEk678tKRvam6qzUWN5ltXUNd81hhpuj/2Re1NUUBsCkargOqY1M08Nw4AALAfy/pN/mr+iphL1AJKA26ZpOYpZaW+yS9aBD+uZROvefNmbf5E2FA0mUUulyx31+mbrdnFVTf3zuv5sIsO13tT1TemMWky9bw4AADAAdxe34jaE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AAAAASUVORK5CYII=" alt="" />
shell脚本学习总结10--系统函数调用的更多相关文章
- 转 shell脚本学习指南
shell脚本学习指南 以下八点不敢说就能成为你shell脚本学习指南de全部,至少可以让你编写出可靠的shell脚本. 1. 指定bashshell 脚本的第一行,#!之后应该是什么?如果拿这个问题 ...
- shell脚本学习之6小时搞定(1)
shell脚本学习之6小时搞定(1) 简介 Shell是一种脚本语言,那么,就必须有解释器来执行这些脚本. Unix/Linux上常见的Shell脚本解释器有bash.sh.csh.ksh等,习惯上把 ...
- 笔记——shell脚本学习指南
<shell脚本学习指南>机械工业出版 ISBN 987-7-111-25504-8 第2章 2.4 初级陷阱 1.当今的系统,对#!这一行的长度限制从63到1024个字符都有,尽量不要超 ...
- Shell脚本学习指南笔记
Shell脚本学习指南 作者:Danbo 2015-8-3 脚本编程语言与编译型语言的差异 许多中型.大型的程序都是用编译型语言写的,例如:C.C+.Java等.这类程序只要从源代码(Source C ...
- Shell 脚本学习资料搜集
Shell文档 ChinaUnix上大神“網中人”总结的Shell十三问,强烈推荐,这本书讲得比较精炼,而且都是一些Shell学习中容易把握不住的一些细节难点.每一问都写得非常精彩.ChinaUnix ...
- 学习笔记之Shell脚本学习指南 & sed与awk & 正则表达式
正则表达式_百度百科 http://baike.baidu.com/link?url=ybgDrN2WQQKN64_gu-diCqdeDqL8LQ-jiQ-ftzzPaNUa9CmgBRDNnyx50 ...
- Shell脚本学习 - 运算符
继续shell脚本学习.上一篇是基本数据类型和语法的总结,这一篇是运算相关的操作. 运算符 bash不支持简单的数学计算,需要依赖其他命令实现. expr可以代为实现. # 表达式一般这么写 ` + ...
- shell脚本学习总结02--数组
bash同时支持普通数组个关联数组,普通数组只能使用整数作为数组的索引,关联数组可以使用字符串作为数组的索引. 数组的定义方法: 在单行中使用一列值定义一个数组 [root@new ~]# array ...
- shell脚本学习(一)
Shell脚本最常用于系统管理工作,或者用于结合现有的程序以完成小型.特定的工作. Shell的特点有: 1. 简单性 2. 可移植性 3. 开发容易 [什么是shell] 简单点理解,就是系统跟计算 ...
随机推荐
- ubuntu安装五笔输入法(ibus-table-wubi)
IBus-Table是为基于码表的输入法即所谓的形码开发的输入法框架,常见的形码有郑码.五笔.仓颉.二笔等. 安装如下: # apt-get install ibus-table-wubi 开 ...
- C#:TextBox控件操作类
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.W ...
- android的通知栏的实现
package com.example.mynotification; import android.os.Bundle; import android.app.Activity; import an ...
- LeetCode 155 Min Stack(最小栈)
翻译 设计支持push.pop.top和在常量时间内检索最小元素的栈. push(x) -- 推送元素X进栈 pop() -- 移除栈顶元素 top() -- 得到栈顶元素 getMin() -- 检 ...
- Python操作redis字符串(String)详解 (三)
# -*- coding: utf-8 -*- import redis #这个redis不能用,请根据自己的需要修改 r =redis.Redis(host=") 1.SET 命令用于设置 ...
- hibernate中继承映射保存
1 简单继承映射,在子类上进行映射配置,可以将父类属性直接配置在子类映射文件中. 简单例子如下:teacher类继承自Person类. public class Person { private in ...
- java同一个实体的复制
import org.springframework.beans.BeanUtils; //将mon的值复制给monitorCommission;monitorCommission是实体Monitor ...
- ThreadPoolExecutor线程池解析与BlockingQueue的三种实现
目的 主要介绍ThreadPoolExecutor的用法,和较浅显的认识,场景的使用方案等等,比较忙碌,如果有错误还请大家指出 ThreadPoolExecutor介绍 ThreadPoolExecu ...
- std::string与output-operator"<<"的兼容问题
经查阅资料得知,“在某些编译器下std::string,需要使用c_str()才能作为output-operator "<<" 的参数” std::string tit ...
- PHP flock() 函数 php中的文件锁定机制
举一个例子: 假设一个文件读取的过程,有数万人在同时操作,那么极可能a用户刚刚写入,b用户也写入了,两者以至于混乱,或者在读取的时候,读取到别人写的数据.就好比上公共厕所,去厕所的时候要把门给打开上, ...