19,619
社区成员




1、[root@h88 /]# touch helloshell
2、[root@h88 /]# ll helloshell
-rw-r--r-- 1 root root 0 01-03 12:13 helloshell
3、[root@h88 /]# chmod +x helloshell
4、[root@h88 /]# ll helloshell
-rwxr-xr-x 1 root root 0 01-03 12:13 helloshell
5、[root@h88 /]# vi helloshell
输入
#!/bin/sh
# 用shell来解释
echo "Hello world!" # 输出Hello world!到屏幕
输入完毕之后,shift+:,输入wq(保存并退出)
6、[root@h88 /]# ./helloshell
Hello world!
#!/bin/bash
echo "Hello world!"
然后shift+z两次(保存)