- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: function defined in /etc/profile
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2006 05:48 AM
11-01-2006 05:48 AM
function defined in /etc/profile
did not display as environment variable.
How can I set up function as environment variable on hp-ux 11.11?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2006 06:01 AM
11-01-2006 06:01 AM
Re: function defined in /etc/profile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2006 06:09 AM
11-01-2006 06:09 AM
Re: function defined in /etc/profile
In the profile, do something like this:
...
function IAM {
echo "I'm ok..."
}
export IAM
...
..Now when you login, at the command prompt you can type:
$ IAM
I'm ok...
...and you can see:
$ typeset
$ typeset|grep IAM
export IAM
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2006 06:09 AM
11-01-2006 06:09 AM
Re: function defined in /etc/profile
When I run env | grep -i cvs, I don't see the cvs function. I setup a linux redhat system, and also defined function cvs in /etc/profile. I can see this cvs function when I run env |grep -i cvs on redhat es4 system.
How can I setup function as global environment variable, so I can see via env command?
function cvs
{
USER=`id -un`
if [ "$USER" = "appmgr" ] || [ "$USER" = "oracle" ] || [ "$USER" = "root" ]
then
/usr/bin/cvs -d :pserver:cvsread@$CVSROOT $@
else
/usr/bin/cvs -d :pserver:$USER@$CVSROOT $@
fi
}
$ env | grep -i cvs
CVS_RSH=remsh
CVSROOT=akrengcvs1:/cvs
$ env | grep -i cvs
CVSROOT=akrengcvs1:/cvs
cvs=() { if [ "$USER" = "appmgr" ] || [ "$USER" = "oracle" ] || [ "$USER" = "root" ]; then
/usr/bin/cvs -d :pserver:cvsread:cvsread@$CVSROOT $@;
/usr/bin/cvs -d :pserver:$USER@$CVSROOT $@;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2006 06:19 AM
11-01-2006 06:19 AM
Re: function defined in /etc/profile
# typeset -f | grep cvs
PCS
- Tags:
- typeset
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2006 06:23 AM
11-01-2006 06:23 AM
Re: function defined in /etc/profile
function cvs
/usr/bin/cvs -d :pserver:cvsread@$CVSROOT $@
/usr/bin/cvs -d :pserver:$USER@$CVSROOT $@
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2006 06:35 AM
11-01-2006 06:35 AM
Re: function defined in /etc/profile
If you want the entire body of function cvs returned:
# typeset -f | awk '/^function cvs$/,/^\}$/ {print}'
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2006 07:10 AM
11-01-2006 07:10 AM
Re: function defined in /etc/profile
/usr/bin/cvs. Somehow, it does not use cvs function, but use /usr/bin/cvs. How can I use cvs function, instead of /usr/bin/cvs.
Thanks for all the reply...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2006 07:29 AM
11-01-2006 07:29 AM
Re: function defined in /etc/profile
in the std /usr/bin/sh, you wont see cvs when you run "env". Use "typeset -f cvs" and it will display the contents of function cvs.
remember to "export cvs" after defining it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2006 02:11 PM
11-01-2006 02:11 PM
Re: function defined in /etc/profile
Hmm, I have never figured out what use exported functions can be. They are not available in other scripts like exported variables. It seems you can only do this if you use typeset -xf cvs. (export doesn't work for me.)
And you can't have #!/bin/ksh at the start of the script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2006 02:33 PM
11-01-2006 02:33 PM
Re: function defined in /etc/profile
Bill Hassell, sysadmin
- Tags:
- FPATH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2006 06:50 PM
11-01-2006 06:50 PM
Re: function defined in /etc/profile
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.
- Tags:
- env
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2006 12:43 AM
11-02-2006 12:43 AM