Shell高亮输出

 1 #!/bin/bash
 2 
 3 NORMAL=$(tput sgr0)
 4 GREEN=$(tput setaf 2; tput bold)
 5 YELLOW=$(tput setaf 3)
 6 RED=$(tput setaf 1)
 7 
 8 function red()
 9 {
10     echo -e "$RED$1$NORMAL"
11 }
12 
13 function green()
14 {
15     echo -e "$GREEN$1$NORMAL"
16 }
17 
18 function yellow()
19 {
20     echo -e "$YELLOW$1$NORMAL"
21 }
22 
23 #to print success
24 green "Task has been completed"
25 
26 #to print error
27 red "The configuration file does not exist"
28 
29 #to print warning
30 yellow "You have to use higher version"

输出:

转载于:https://www.cnblogs.com/meyao/p/shell_hight_light_show.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值