H2
H3
这是H3
H3
下载地址
H3
#!/bin/bash
# 上面一行是指定解释器,告诉系统用 Bash 来执行此脚本
echo "Hello, World!" # 打印文本
current_dir=$(pwd) # 命令替换,将 pwd 的输出赋值给变量
echo "当前目录是:$current_dir" # 变量引用
# 条件判断
if [ -f "hello.sh" ]; then
echo "文件 hello.sh 存在!"
fi
# 循环
for i in {1..5}; do
echo "计数:$i"
done