For this tutorial, I am using vim editor as my text editing tool.
Open a terminal of your Linux distribution. Type following command to create shell file.
$ vim myfirst.shType following code snippet in it.
#!/bin/bash # My first script echo "Hello World!"
Save the script !
Type following shell command to set execution permission to your shell script.
$ chmod +x script_nameOr
$ chmod 755 script_nameIn our example, Type chmod +x myfirst.sh and press enter.
Run your Script !
Type one of following shell command.
$ bash myfirstOr
$ sh myfirstOr
$ ./myfirst
That's it !
Hello Word Text will prints in your terminal. !
0 comments:
Post a Comment
Ask anything about this Tutorial.