Bash Logo

Shell Learning Notes Comment

Shell Comment Start with # # this is a line of comment Simply write more with # start # Author: Aimer Neige # Email: aimer.neige@aimerneige.com # Date: 2022-04-29 Other way: :<<EOF Author: Aimer Neige Email: aimer.neige@aimerneige.com Date: 2022-04-29 EOF :<<' Author: Aimer Neige Email: aimer.neige@aimerneige.com Date: 2022-04-29 ' :<<! Author: Aimer Neige Email: aimer.neige@aimerneige.com Date: 2022-04-29 ! Refer Link https://www.runoob.com/linux/linux-shell-variable.html

May 1, 2022 · Aimer Neige
Bash Logo

Shell Learning Notes Parameters

Pass Parameters When you are running a shell script and you want to pass some parameters into the script, you can get the parameters by $n. The n represents a number, the 1 is meant for the first parameters you pass to the script, the 2 is the second parameters you pass to the script, and so on. Note that the 0 is the script fine name. Example: #!/usr/bin/bash echo "Parameters Example:" echo "The Script File Name: \"$0\"" echo "The First Parameters: \"$1\"" echo "The Second Parameters: \"$2\"" echo "The Third Parameters: \"$3\"" echo "The Forth Parameters: \"$4\"" Run this script:...

May 1, 2022 · Aimer Neige
Bash Logo

Shell Learning Notes Variable

Shell Variable Define Variable You are not allowed to add $ when defining a variable, while in php, you need it. For example: your_name="Aimer Neige" Like other programming languages, you need to follow these rules: You can only use letters, numbers, and underscores, and the first character can not be numbers. You are not allowed to add space, use underscores _ replace. You are not allowed to use special characters. You can not use any keywords used by bash....

April 30, 2022 · Aimer Neige