通用shell函数库
2024-09-01 01:43:12
1、输出字体颜色库
#!/bin/bash export black='\E[0m\c'
export boldred='\E[1;31m\c'
export boldgreen='\E[1;32m\c'
export boldyellow='\E[1;33m\c'
export boldblue='\E[1;34m\c'
export boldmagenta='\E[1;35m\c'
export boldcyan='\E[1;36m\c' c_notify=$boldgreen #通过变量来修改颜色
c_error=$boldred cecho()
{
message=$
color=${:-$black} echo -e "$color"
echo -e "$message"
tput sgr0 # Reset to normal.
echo -e "$black"
return
} cecho "1. #################" $boldred
cecho "2. #################" $boldgreen
cecho "3. #################" $boldyellow
cecho "4. #################" $boldblue
cecho "5. #################" $boldmagenta
cecho "6. #################" $boldcyan cecho "启动成功" $c_notify
cecho "启动失败" $c_error
输出效果:
最新文章
- PIC10F200/202/204/206/220/222/320/322芯片解密程序复制多少钱?
- sudo apt-get install apache2 php7.0 php7.0-mysql mysql-server
- 【Alpha】团队贡献分配计划
- Java数据库——CallableStatement接口
- wordpress如何批量关闭旧日志留言功能
- How to mount a NFS share?
- Design Patterns---- Strategy 模式
- 在windows下使用linux的开发环境
- C#路径/文件/目录/I/O常见操作汇总<;转载>;
- struts2 模型驱动的action赋值优先顺序
- Android UI - 实现广告Banner旋转木马效果
- iOS 导航栏去阴影
- 基于requirejs和angular搭建spa应用
- Docker rancher 部署
- day 21 内存管理,正则
- day 7 -1 进程理论知识
- liunx中的iptables
- 每天学习一个Linux命令-目录
- [yum] yum使用光盘安装或更新软件
- Linux基础命令---文本格式转换fmt