Simpler Navigation coming for Servers and Operating Systems
Coming soon: a much simpler Servers and Operating Systems section of the Community. We will combine many of the older boards, and you won't have to click through so many levels to get at the information you need. If you are looking for an older board and do not find it, check the consolidated boards, as the posts are still there.
cancel
Showing results for 
Search instead for 
Did you mean: 

FPATH and Linux

Dave Burton_5
Occasional Advisor

FPATH and Linux

On HP-UX servers, I set my FPATH, type the name of a function file in that FPATH and all the functions in the file are loaded into my shell ready to make my life easier.

How do I achieve the same thing on Linux? If it makes a difference, I'm using RedHat, various versions.

Cheers
Dave
2 REPLIES
Steven E. Protter
Exalted Contributor

Re: FPATH and Linux

I don't set FPATH on HP-UX. I set up my function library in /usr/contrib/bin and make sure its on the PATH.

That will probably work for you.

You can try setting the variable and setting it up line HP-UX. Its a posix shell, so it might work exactly the same way.

Set it in .profile or /etc/profile

And, I would not mind seeing how you do it in HP-UX. Sounds like a neat sysadmin enhancement.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Dave Burton_5
Occasional Advisor

Re: FPATH and Linux

Steven,

It turns out the solution on Linux is just as on HP-UX. It was failing consistently when I tried before, but works fine when I try today. My shell must have been broken, and it never occurred to me to start a new one.

My approach is nothing special:

export FPATH=/home/daveb
Create a file called funcs in /home/daveb:
function funcs
{
sleep 0
}

function dothis
{
commands
}

function dothat
{
commands
}

etc

Then when I start a new shell, I just type funcs and I can use all these functions from the command line. (I could stick this in a startup file, but we share IDs here, and other people would get confused if they accidentally invoked one of my functions.)

Cheers
Dave