Linux学习记录(五):shell脚本
一、现有test.sh脚本如下:
#!/bin/bash
echo "Hello World"
echo字符串 需要加引号''''
方法一:
方法二:
sh test.sh拓展名为sh,那么用sh解释执行就可以了
二、for循环打印
#/bin/bash
for SCENE in animal building plant sky water grass mountain
do
unzip ${SCENE}.zip
done
https://poe.com/chat/2xs7q4a1p7mql2pxkl9
三、Windows上运行bash脚本
首先推荐在Linux系统上运行bash脚本,如果想在Windows系统上运行,则需要安装Git,Git Bash中运行即可。

浙公网安备 33010602011771号