首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >shell 脚本初体验

shell 脚本初体验

作者头像
Cell
发布于 2022-02-25 15:42:17
发布于 2022-02-25 15:42:17
3200
举报
文章被收录于专栏:Cell的前端专栏Cell的前端专栏

今天上机学了几个小命令

  • read
  • echo
  • if

然后自己写了一个小脚本觉得还挺有趣的

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54

#!/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

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2018-10-29,如有侵权请联系 cloudcommunity@tencent.com 删除
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档