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+mbrdnFVTf3zuv5sIsO13tT1TemMWky9bw4AADAAdxe34jaEm3iDPpGUyqjAa1/+XZ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" />

shell脚本学习总结10--系统函数调用的更多相关文章

  1. 转 shell脚本学习指南

    shell脚本学习指南 以下八点不敢说就能成为你shell脚本学习指南de全部,至少可以让你编写出可靠的shell脚本. 1. 指定bashshell 脚本的第一行,#!之后应该是什么?如果拿这个问题 ...

  2. shell脚本学习之6小时搞定(1)

    shell脚本学习之6小时搞定(1) 简介 Shell是一种脚本语言,那么,就必须有解释器来执行这些脚本. Unix/Linux上常见的Shell脚本解释器有bash.sh.csh.ksh等,习惯上把 ...

  3. 笔记——shell脚本学习指南

    <shell脚本学习指南>机械工业出版 ISBN 987-7-111-25504-8 第2章 2.4 初级陷阱 1.当今的系统,对#!这一行的长度限制从63到1024个字符都有,尽量不要超 ...

  4. Shell脚本学习指南笔记

    Shell脚本学习指南 作者:Danbo 2015-8-3 脚本编程语言与编译型语言的差异 许多中型.大型的程序都是用编译型语言写的,例如:C.C+.Java等.这类程序只要从源代码(Source C ...

  5. Shell 脚本学习资料搜集

    Shell文档 ChinaUnix上大神“網中人”总结的Shell十三问,强烈推荐,这本书讲得比较精炼,而且都是一些Shell学习中容易把握不住的一些细节难点.每一问都写得非常精彩.ChinaUnix ...

  6. 学习笔记之Shell脚本学习指南 & sed与awk & 正则表达式

    正则表达式_百度百科 http://baike.baidu.com/link?url=ybgDrN2WQQKN64_gu-diCqdeDqL8LQ-jiQ-ftzzPaNUa9CmgBRDNnyx50 ...

  7. Shell脚本学习 - 运算符

    继续shell脚本学习.上一篇是基本数据类型和语法的总结,这一篇是运算相关的操作. 运算符 bash不支持简单的数学计算,需要依赖其他命令实现. expr可以代为实现. # 表达式一般这么写 ` + ...

  8. shell脚本学习总结02--数组

    bash同时支持普通数组个关联数组,普通数组只能使用整数作为数组的索引,关联数组可以使用字符串作为数组的索引. 数组的定义方法: 在单行中使用一列值定义一个数组 [root@new ~]# array ...

  9. shell脚本学习(一)

    Shell脚本最常用于系统管理工作,或者用于结合现有的程序以完成小型.特定的工作. Shell的特点有: 1. 简单性 2. 可移植性 3. 开发容易 [什么是shell] 简单点理解,就是系统跟计算 ...

随机推荐

  1. VS2010/MFC编程入门之四十四:定时器Timer

    前面一节鸡啄米讲了CTime类和CTimeSpan类的使用,本节继续讲与时间有关的定时器.定时器并不是一个类,主要考虑到,提起时间的话就不能不说定时器,所以就把它放到CTime和CTimeSpan之后 ...

  2. oracle和其他数据库对表名、列名的长度限制

    ============== 数据库 表名列名长度限制问题 今天修改数据库表名,感觉现有的定义列名都无含义...修改后被同事告知,列名有点长,怕有的数据库不支持.. 我头一次听说数据库表名和列名长度限 ...

  3. QT类之------QLabel

    QLabel 类代表标签,它是一个用于显示文本或图像的窗口部件. 构造 QLabel 类支持以下构造函数: [plain] view plaincopy QLabel(QWidget *parent  ...

  4. vue 和ng的区别

    vue:    读音:    v-u-e    view vue到底是什么?        一个mvvm框架(库).和angular类似        比较容易上手.小巧    mvc:       ...

  5. java web hello world(二)基于Servlet理解监听

    java web最开始实现是通过Servlet实现,这里就来实现下,最原始的监听是如何实现的. 第一步,创建一个基本的web项目 ,参见(java web hello world(一)) 第二步,we ...

  6. 确定文件的位置--浏览文件夹对话框folderBrowserDialog

    private void button1_Click(object sender, EventArgs e) { folderBrowserDialog1.ShowNewFolderButton = ...

  7. shell 后台执行脚本

    nohup command > myout.file 2>&1 &

  8. Github优秀开源项目

    王潜升 https://github.com/code4craft/webmagic 一个爬虫框架,除了不会反爬虫外(当然可以自己加)其他都很牛逼.这个项目更新还是很快的.   ansi分词  htt ...

  9. jvm 调整tomcat的堆内存和常驻内存catalina.sh

    4.2 性能优化 tomcat性能取决于你的内存大小 上策:优化代码 中策:jvm优化机制  垃圾回收机制 把不需要的内存回收   优化jvm--优化垃圾回收策略 优化catalina.sh配置文件. ...

  10. zabbix监控数据库

    Zabbix通过percona监控MySQL   因为Zabbix自带的MySQL监控没有提供可以直接使用的Key,所以一般不采用,业界的同学们都使用Percona Monitoring Plugin ...