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中运行即可。

posted @ 2024-12-03 20:49  梦一场6688  阅读(18)  评论(0)    收藏  举报