shell 脚本初体验

今天上机学了几个小命令

  • read
  • echo
  • if
    然后自己写了一个小脚本觉得还挺有趣的
#!/bin/bash
#liruihao
#menu.sh
#sudo apt curl install nyancat sl figlet toilet cowsay 
echo "-------------菜-单--------------"
echo "------------1-打印二维码--------"
echo "------------2-彩虹猫------------"
echo "------------3-小火切------------"
echo "------------4-打字机------------"
echo "------------5-小许牛------------"
echo "----------Ctrl+c暂停程序--------"
echo ""
echo "请输入序号!"
read i
if test $i -eq 1
then
	echo "请输入网址!"
	read s1
       	echo $s1 |curl -F-=\<- qrenco.de
fi
if test $i -eq 2
then
	nyancat
fi
if test $i -eq 3
then
	sl
fi
if test $i -eq 4
then
	echo "请输入字符串!"
	read s2
	echo "选择样式:"
	echo "------样式1-----"
	echo "------样式2-----"
	read j
	if test $j -eq 1
	then
		figlet $s2
	else
		toilet -f mono12 -F gay $s2
	fi
fi
if test $i -eq 5
then
	echo "请输入字符串!"
	read s3
	cowsay $s3
fi
echo "任意建继续!"
read x
clear
./menu.sh

本文作者: 李瑞豪
修改时间: 2019-02-18 11:27:09
本文链接: https://lruihao.cn/posts/shell.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值