linux字符拼装ASCII超大字母Banner

在运行shell脚本时,经常会在开始的时候醒目地显示一些和作者或者软件相关的一些信息,如centos


 #####   #######  #     #  #######  #######   #####   
#     #  #        ##    #     #     #     #  #     #  
#        #        # #   #     #     #     #  #        
#        #####    #  #  #     #     #     #   #####   
#        #        #   # #     #     #     #        #  
#     #  #        #    ##     #     #     #  #     #  
 #####   #######  #     #     #     #######   #####   

如果手工输入当然能够实现(如果你不嫌累的话)……来解放你的时间干点有用的吧~ banner

安装

以centos为例

[root@mesoscloud_test255148 yueling]# yum install banner
……
Install  1 Package

Total download size: 22 k

  Installing : banner-1.3.4-3.el7.x86_64                       1/1 
  Verifying  : banner-1.3.4-3.el7.x86_64                       1/1 

Installed:
  banner.x86_64 0:1.3.4-3.el7                                            
Complete!

使用

非常简单
比如是单个词语的,直接:

[root@mesoscloud_test255148 yueling]# banner banner 

######      #     #     #  #     #  #######  ######   
#     #    # #    ##    #  ##    #  #        #     #  
#     #   #   #   # #   #  # #   #  #        #     #  
######   #     #  #  #  #  #  #  #  #####    ######   
#     #  #######  #   # #  #   # #  #        #   #    
#     #  #     #  #    ##  #    ##  #        #    #   
######   #     #  #     #  #     #  #######  #     #  

[root@mesoscloud_test255148 yueling]# 

如果是多个单词的,需要加引号

[root@mesoscloud_test255148 yueling]# banner "banner more"

######      #     #     #  #     #  #######  ######         #     #  #######  ######   #######  
#     #    # #    ##    #  ##    #  #        #     #        ##   ##  #     #  #     #  #        
#     #   #   #   # #   #  # #   #  #        #     #        # # # #  #     #  #     #  #        
######   #     #  #  #  #  #  #  #  #####    ######         #  #  #  #     #  ######   #####    
#     #  #######  #   # #  #   # #  #        #   #          #     #  #     #  #   #    #        
#     #  #     #  #    ##  #    ##  #        #    #         #     #  #     #  #    #   #        
######   #     #  #     #  #     #  #######  #     #        #     #  #######  #     #  #######  

[root@mesoscloud_test255148 yueling]# 

不加引号会生产换行的两行~

[root@mesoscloud_test255148 yueling]# banner banner more

######      #     #     #  #     #  #######  ######   
#     #    # #    ##    #  ##    #  #        #     #  
#     #   #   #   # #   #  # #   #  #        #     #  
######   #     #  #  #  #  #  #  #  #####    ######   
#     #  #######  #   # #  #   # #  #        #   #    
#     #  #     #  #    ##  #    ##  #        #    #   
######   #     #  #     #  #     #  #######  #     #  


#     #  #######  ######   #######  
##   ##  #     #  #     #  #        
# # # #  #     #  #     #  #        
#  #  #  #     #  ######   #####    
#     #  #     #  #   #    #        
#     #  #     #  #    #   #        
#     #  #######  #     #  #######  

[root@mesoscloud_test255148 yueling]#

缺点:只支持字母和英文符号不支持中文

附录

更新@20180709,在前辈们的博文中发现比较牛的在线生成ascii工具,补充也顺便备注一下
文字在线生成工具 http://patorjk.com/software/taaghttp://www.bootschool.net/ascii 比较丰富支持多种字体
图片在线转成ascii https://www.degraeve.com/img2txt.php

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值