-
shell pipeline
To successfully write a shell script, we have to do three things:
-
Write a script
A shell script is a file that contains ASCII text.
vim script.sh
:#!/bin/bash # My first script echo "Hello World"
The first line of the script
#!/bin/bash
is a special construct, called a shebang, given to the system indicating what program is to be used to interpret the script.The second line is a comment.
-
Setting Permissions
chmod 755 script.sh
-
Putting It in Our Path
./script.sh
-
Reference
如何写shell脚本
最新推荐文章于 2024-08-06 10:36:58 发布