编写第一个Shell脚本
Linux中有好多中不同的shell,bash是linux默认的shell,免费且容易使用。
su切换为root权限
1.创建shell脚本
touch hello.sh
2.编辑:
vi hello.sh
内容
#! /bin/bash
#the first program echo "hello world"
3.保存并退出
按Esc取消插入,输入:wq保存
==================
可以使用bash运行hello.sh
或
==================
4.赋予执行权限
chmod 755 hello.sh
755/u+x
5.直接运行
./hello.sh
过程:

本文来自博客园,作者:tinyphp,转载请注明原文链接:https://www.cnblogs.com/tinyphp/p/5072498.html
向着星辰与深渊,博客园加油

浙公网安备 33010602011771号