Prerequisite:
Any shell. Preferably bash
Any editor which is convenient to you.Preferably vi. But there is no need of editor to write simple shell script.
STEP 1: Creation of script file with name as hello.sh
volcano@volcano-laptop:~/shellscript$ cat > hello.sh
#!/bin/bash
#Script to demonstrate
echo "Hello World!"
STEP 2: Setting up execute permission to the script
volcano@volcano-laptop:~/shellscript$ chmod u+x hello.sh
STEP 3: Execution of script in the command line
volcano@volcano-laptop:~/shellscript$ ./hello.sh
Hello World!
No comments:
Post a Comment