Add user defined function in main library
Hi friends
I have wrote a chk_err function which checks for error in a shell script logfile.sh. I want to use this function in other shell script but without writing the function again instead I just want to call this function there. Can anybody help me out how can i do that.The prob is how i will add user defined function in main library so that i can access it everywhere Thanks Kamal |
You can source another file in a script with
Quote:
Quote:
|
To expand slightly on the above, sourcing a file in another will execute it inside the current script and thus make it's variables and functions available. Note that one, it will run the code.
Code:
source check_err.sh |
All times are GMT -5. The time now is 12:01 PM. |