
shell脚本实战
Turf96
此人不懒,但什么都没有写
展开
-
shell脚本实战——打印九九乘法表
目的:打印九九乘法表思路:采用for循环,外循环打印行,内循环打印列新建一个demo.sh脚本文件,输入以下代码#!/bin/bash#Date: 2019.01.18#Author: TURF#Mail: 994992468@qq.com#Function: print multiplication table#Version: ...原创 2019-01-18 23:46:48 · 1541 阅读 · 0 评论 -
shell脚本实战——给脚本传参并进行基本运算
目的:给脚本传参并进行基本预算思路:先传参后运算传参:在命令行传入两个整数,如 $ bash demo.sh a b; 在shell脚本中$1和$2表示这两个参数运算:$[] $(()) expr let #!/bin/bash#Date: 2019.01.19#Author: TURF#Mail: 994992468@qq.com#Function: pass par...原创 2019-01-20 21:57:19 · 875 阅读 · 0 评论 -
树莓派开机自动运行shell脚本——记录开机时间
目录1.目的2.思路3.实现步骤 1.目的:树莓派开机时自动执行某些脚本,不用手动设置,减少麻烦。2.思路:新建一个记录时间的脚本 record_time.sh,然后添加执行命令到 /etc/rc.local文件中3.实现步骤(1) 新建一个 bash shell 脚本$ touch /home/pi/autoExec/record_time.sh (2)...原创 2019-02-23 20:14:21 · 5727 阅读 · 0 评论 -
Linux Ubuntu/树莓派 开机后台运行shell命令/脚本
编辑 # /etc/rc.local 文件,在文件 exit 0 之前添加执行的命令# cat /etc/rc.local #!/bin/sh -e## rc.local## This script is executed at the end of each multiuser runlevel.# Make sure that the script will "exit 0"...原创 2019-06-30 21:39:27 · 2268 阅读 · 1 评论