Operating System - Linux
1748265 Members
3853 Online
108760 Solutions
New Discussion юеВ

Re: function defined in /etc/profile

 
Bill Hassell
Honored Contributor

Re: function defined in /etc/profile

A more portable solution might be to create a function directory, store the function as a file in this directory and then have /etc/profile export FPATH=/functiondirectory. Now the environment will have a function path available to any script.


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: function defined in /etc/profile

>Bill Hassell: A more portable solution ...

Exactly, though the ksh/sh man pages (under Functions) say you should put them in your ENV file. This is a more individual, rather than system wide. And may only work for interactive shells if you use the magic ENV encantation.
Tammy Liang
Regular Advisor

Re: function defined in /etc/profile

Thanks for all the suggestion. I work around to write a customer script for using cvs command and ask user to use this customer cvs script. One thing I found out through this instance is that hp-ux and redhat linux threat functions that defined in /etc/profile differently.
take easy, enjoy life