1,编写shell脚本通过sl命令使屏幕跑一辆火车
脚本制作编写:
1,首先需要先安装sl软件包,yum -y install sl
2,编写脚本。
#!/bin/bash
n=0
while (($n<=1));
do
sl
sleep 3s
done
执行脚本,即可出现上图效果。
2,编写shell脚本通过cowsay命令输出各种小图案。
1,需要先安装 cowsay软件包,yum -y install cowsay
2,编写脚本。
#!/bin/bash
for i in hellokitty kiss kitty koala kosh mech-and-cow meow milk moose mutilated ren satanic sheep skeleton small sodomized stegosaurus stimpy supermilker surgery telebears;
do
cowsay -f $i "坑爹啊"
sleep 3s
done
执行脚本,即可出现上图效果。
3,编写shell脚本通过boxes命令输出各种小图案。
1,需要先安装 boxes软件包,yum -y install boxes
2,编写脚本。
#!/bin/bash
for i in santa dog cat boy girl diamonds sunset xes unicornthink twisted spring peek mouse
do
echo "天雷好怕怕,劈的掉渣渣" | boxes -d $i -a c
echo
sleep 1s
done
boxes命令还支持好多图案,使用boxes -l即可查看所有支持的图案。
4,pv命令输出电影字幕效果
1,需要先安装 pv软件包,yum -y install pv
2,直接执行下面的命令即可~
echo "Happiness is like a pebble dropped into a pool to set in motion an ever-widening circle of ripples. As Stevenson has said, being happy is a duty." |pv -qL 10
大家可以自己在终端输出打印试试看,也可以通过编写shell脚本输出长篇短文看看字幕效果^_^
最后再声明下,此脚本编写全当娱乐,对实际生产没啥用哦!!!!