More On Shell Scriptingแฃแแแ แฅแแณแจแแ แจshell scripting แแ purpose tasks automate แแแจแ แแแข แแแตแ commands แ แแต แ แ แแต แฅแจแแแ terminal แแญ execute แจแแจแ แ แ แแด script แฅแแ แแ แตแ แฐแต/ bug แฅแตแจแแแ แต แตแจแต every lines will be executed one after the other.
แแแณแ แก
แ แแต "Hello, Ethiopia!" แฅแ terminal แแญ print แจแแซแจแ แจshell script แฅแแแแฃ แแ แแฐแฑแ แแแจแณแต แจแแญ แซแแแ แ แญแญ video แฐแแแจแฑแข
1. แ แแแแชแซ text editor แฅแแจแแณแแ (such as nano, vim, or gedit) and hello.sh แจแฐแฃแ file แฅแแแฅแซแแแข แฅแแ video แแญ แจแฐแ แแแแ text editor nano แแแข
nano hello.shแจแ แแญแ แแตแฅ แฅแแแ แ แแแฎแฝ แฅแแ แแแ
#!/bin/bash#line_1 "#!/bin/bash" /shebang line/ แฅแแ แจแแญ แจแแแแ scriptu แ bash shell interpreter execute แฅแแฒแแแแ แแ แข
# This is a comment
echo "Hello, Ethiopia!"
แ programming comment แจแแแแ a text still in the code yet not executed, แ shell Scripting comment แแแ แจแแแแ textun แ "#" แฅแแแแซแแแข
แแแณแ the 2nd line of our script does nothing because it is a comment.
Interpreter แจแแแแ itself is a program that translates and executes code written in a high-level programming language in to machine code(which is understandable by the computer).
2. แจแ แ แแ we will save our hello.sh script file.
nano แจแแตแ แแ แจแแ แแแแชแซ แแญ "CTRL - O" to save the file then "CTRl - X" to exit from the text editor.
3. แ แแฃแญ แจแแแจแแ script แแญแแ executable แแจแ แแ: แแญแ permission แแตแ แต แแ for the file to be executed.
แตแ file permission แ แแฃแญ แฅแแแซแแ but for now just do this.
chmod +x hello.sh4. แ แแจแจแป แจแแจแ แแแญ scriptun run แแจแ แแแฃ to do this:
./hello.shแญแ script run แตแแจแแ bash interpreter แ แแ แแ the code runs and a text "Hello, Ethiopia!" is printed in our terminal, this was done by the command "echo".
แญแ แแแ แแณแ แแ แแแฝ แฎแถแฝแ แ แแแ shell Scripting แฐแแแแฑแข
#ShellScripting
#PythonPioneers
@python_pioneers
@python_pioneers
@python_pioneers
๐3๐ฅ2