Reputation: 645
I have written a function called
random_init()
It takes two parameters username and password.Is there a way to call it from the terminal like this.
$ random init username password
Any help is appreciated.
Upvotes: 0
Views: 166
Reputation: 1279
Just add the function in your .bashrc file
, then you can call like this
random_init 'username' 'password'
Upvotes: 0
Reputation: 74596
Just source
the script in which your function is defined:
. my_script.sh
# or (bash)
source my_script.sh
Then call your function:
random_init 'username' 'password'
Upvotes: 2