So how do you group them? You create a shell function or subroutine. Here's how
Create your bash / shell script function:
vi /path/to/your/desired/function/file #my_function my_function(){ echo "Isang halimbawa galing kay ulaptech" }
Expose the bash function:
Note: You can type it to your shell console and the command becomes available. You can also use the same method to include it to other bash scripts and it becomes available as a command.
Warning: Make sure you don't use the same namespace used by the OS and other functions or you'll end up with all sorts of weird results.
vi /path/to/your/desired/function/file #include it to your runtime environment . /path/to/your/desired/function/file
The guide above is applicable to most linux systems but was primarily tested for CentOS and RHEL.
No comments:
Post a Comment