Hi,
How to make function command persistent in Linux.
Regards,
Sandeep
Function command persistent
Re: Function command persistent
Do you mean the function facility in bash?
-
- Posts: 15
- Joined: 2015/09/23 14:16:41
Re: Function command persistent
Means after reboot it should be work.
Regards,
Sandeep Powar
Regards,
Sandeep Powar
-
- Posts: 10642
- Joined: 2005/08/05 15:19:54
- Location: Northern Illinois, USA
Re: Function command persistent
What should work?
What is the real problem you are having?
What is the real problem you are having?
Re: Function command persistent
I know what persistent means! What I don't understand is what function command?
-
- Posts: 15
- Joined: 2015/09/23 14:16:41
Re: Function command persistent
for your reference Please find below example
function
[root@localhost ~]# hello () { echo "Hello,let's be friend" ; }
[root@localhost ~]# hello --> enter
Hello, let's be friend
I define hello with function () after hello --> enter i got Hello, let's be friend
but this is temporary after reboot hello command not give result Hello, let's be friend
I want to persistent function ()
Regards,
Sandeep
function
[root@localhost ~]# hello () { echo "Hello,let's be friend" ; }
[root@localhost ~]# hello --> enter
Hello, let's be friend
I define hello with function () after hello --> enter i got Hello, let's be friend
but this is temporary after reboot hello command not give result Hello, let's be friend
I want to persistent function ()
Regards,
Sandeep
Re: Function command persistent
Okay, you mean the function facility that is available in various shells, I'll assume bash.
To make it persistent, put it in a script that executes upon login (like .bashrc or .bash_profile).
So define the function as you have at the command line in your (say) .bashrc. Logout/login (or reboot if you prefer) and test.
To make it persistent, put it in a script that executes upon login (like .bashrc or .bash_profile).
So define the function as you have at the command line in your (say) .bashrc. Logout/login (or reboot if you prefer) and test.