Shell脚本

概念:

shell脚本是纯文本文件

特点:

shell脚本扩展名为sh,第一行一定为#!/bin/bash,表示使用bash

cpp 复制代码
#!/bin/bash
echo "hello world"             //输出 hello world

echo "please input name:"      //echo是展示
read name                      //read是读取输入 并保存到name中
echo "your name:"$name

推荐书籍:鸟哥的Linux私房菜,有详细介绍shell脚本

相关推荐
白狐_79815 小时前
硬核实战:从零构建飞书 × OpenClaw 自动化情报站(五)
运维·自动化·飞书
幸福指北1 天前
我用 Tauri + Vue 3 + Rust 开发了这款跨平台网络连接查看工具PortView,性能炸裂!
运维·网络·监控
V__KING__1 天前
systemd-remount-fs,fstab之间的渊源
linux·服务器·网络
酿情师1 天前
Windows Subsystem for Linux (WSL, Ubuntu)安装教程(详细)
linux·windows·ubuntu
Titan20241 天前
Linux环境变量个人笔记
linux·服务器·c++
青柠代码录1 天前
【Linux】路径区分:testdir、testdir/、testdir/*
linux·运维·服务器
7yewh1 天前
jetson_yolo_deployment 02_linux_dev_skills
linux·python·嵌入式硬件·yolo·嵌入式
djarmy1 天前
ubuntu20.04搭建openharmony6.0的master分支。构建编译环境报错解决记录
c语言·ubuntu
supersolon1 天前
Windows下WSL(Ubuntu24.04)安装Nodejs
linux·ubuntu·node.js
进击切图仔1 天前
跨系统时间戳同步问题解决总结
linux