Create bash script,
Create file: script.sh
#!/bin/bash
date echo "testing"
Apply executable permission.
# chmod 0777 script.sh
Move script to /usr/local/bin/
# mv script.sh /usr/local/bin/
Now you can execute script from anywhere.
# cd /home/# script.sh
output:
Thu Nov 18 11:05:41 IST 2021testing
No comments:
Post a Comment