Creating basic shell scripts
93
Then, we can run it by using the bash command interpreter with the following line:
[root@rhel-instance
]# bash hello.shhello world!There is a different way to do this where we do not need to type bash. We can add an initial line
referencing the interpreter, so the file content of hello.sh looks as follows:
#!/bin/bash echo 'hello world!''
Now, we change the permissions to make it executable:
[root@rhel-instance
]# ls -l hello.shShare with your friends: