<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: function defined in /etc/profile in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890824#M99212</link>
    <description>Hi Tammy:&lt;BR /&gt;&lt;BR /&gt;In the profile, do something like this:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;function IAM {&lt;BR /&gt;   echo "I'm ok..."&lt;BR /&gt;}&lt;BR /&gt;export IAM&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;..Now when you login, at the command prompt you can type:&lt;BR /&gt;&lt;BR /&gt;$ IAM&lt;BR /&gt;I'm ok...&lt;BR /&gt;&lt;BR /&gt;...and you can see:&lt;BR /&gt;&lt;BR /&gt;$ typeset&lt;BR /&gt;$ typeset|grep IAM&lt;BR /&gt;export IAM&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Wed, 01 Nov 2006 14:09:21 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2006-11-01T14:09:21Z</dc:date>
    <item>
      <title>function defined in /etc/profile</title>
      <link>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890822#M99210</link>
      <description>I have functions defined in /etc/profile, but&lt;BR /&gt;did not display as environment variable.&lt;BR /&gt;How can I set up function as environment variable on hp-ux 11.11?&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Nov 2006 13:48:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890822#M99210</guid>
      <dc:creator>Tammy Liang</dc:creator>
      <dc:date>2006-11-01T13:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: function defined in /etc/profile</title>
      <link>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890823#M99211</link>
      <description>Could you post a sample of what you're doing (for clarity)?</description>
      <pubDate>Wed, 01 Nov 2006 14:01:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890823#M99211</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2006-11-01T14:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: function defined in /etc/profile</title>
      <link>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890824#M99212</link>
      <description>Hi Tammy:&lt;BR /&gt;&lt;BR /&gt;In the profile, do something like this:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;function IAM {&lt;BR /&gt;   echo "I'm ok..."&lt;BR /&gt;}&lt;BR /&gt;export IAM&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;..Now when you login, at the command prompt you can type:&lt;BR /&gt;&lt;BR /&gt;$ IAM&lt;BR /&gt;I'm ok...&lt;BR /&gt;&lt;BR /&gt;...and you can see:&lt;BR /&gt;&lt;BR /&gt;$ typeset&lt;BR /&gt;$ typeset|grep IAM&lt;BR /&gt;export IAM&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 01 Nov 2006 14:09:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890824#M99212</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-11-01T14:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: function defined in /etc/profile</title>
      <link>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890825#M99213</link>
      <description>I have function cvs defined in /etc/profile.&lt;BR /&gt;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.&lt;BR /&gt;How can I setup function as global environment variable, so I can see via env command?&lt;BR /&gt;&lt;BR /&gt;function cvs&lt;BR /&gt;{&lt;BR /&gt;  USER=`id -un`&lt;BR /&gt;  if [ "$USER" = "appmgr" ] || [ "$USER" = "oracle" ] || [ "$USER" = "root" ]&lt;BR /&gt;  then&lt;BR /&gt;    /usr/bin/cvs -d :pserver:cvsread@$CVSROOT $@&lt;BR /&gt;  else&lt;BR /&gt;    /usr/bin/cvs -d :pserver:$USER@$CVSROOT $@&lt;BR /&gt;  fi&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;$ env | grep -i cvs&lt;BR /&gt;CVS_RSH=remsh&lt;BR /&gt;CVSROOT=akrengcvs1:/cvs&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$ env | grep -i cvs&lt;BR /&gt;CVSROOT=akrengcvs1:/cvs&lt;BR /&gt;cvs=() {  if [ "$USER" = "appmgr" ] || [ "$USER" = "oracle" ] || [ "$USER" = "root" ]; then&lt;BR /&gt; /usr/bin/cvs -d :pserver:cvsread:cvsread@$CVSROOT $@;&lt;BR /&gt; /usr/bin/cvs -d :pserver:$USER@$CVSROOT $@;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Nov 2006 14:09:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890825#M99213</guid>
      <dc:creator>Tammy Liang</dc:creator>
      <dc:date>2006-11-01T14:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: function defined in /etc/profile</title>
      <link>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890826#M99214</link>
      <description>Hi Tammy,&lt;BR /&gt;&lt;BR /&gt;# typeset -f | grep cvs&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Wed, 01 Nov 2006 14:19:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890826#M99214</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-11-01T14:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: function defined in /etc/profile</title>
      <link>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890827#M99215</link>
      <description>$ typeset -f |grep -i cvs&lt;BR /&gt;function cvs&lt;BR /&gt;    /usr/bin/cvs -d :pserver:cvsread@$CVSROOT $@&lt;BR /&gt;    /usr/bin/cvs -d :pserver:$USER@$CVSROOT $@&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Nov 2006 14:23:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890827#M99215</guid>
      <dc:creator>Tammy Liang</dc:creator>
      <dc:date>2006-11-01T14:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: function defined in /etc/profile</title>
      <link>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890828#M99216</link>
      <description>Tammy,&lt;BR /&gt;&lt;BR /&gt;If you want the entire body of function cvs returned:&lt;BR /&gt;&lt;BR /&gt;# typeset -f | awk '/^function cvs$/,/^\}$/ {print}' &lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Wed, 01 Nov 2006 14:35:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890828#M99216</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-11-01T14:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: function defined in /etc/profile</title>
      <link>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890829#M99217</link>
      <description>Mainly I want to be able to use cvs function that defined in /etc/profile instead of &lt;BR /&gt;/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.&lt;BR /&gt;&lt;BR /&gt;Thanks for all the reply...</description>
      <pubDate>Wed, 01 Nov 2006 15:10:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890829#M99217</guid>
      <dc:creator>Tammy Liang</dc:creator>
      <dc:date>2006-11-01T15:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: function defined in /etc/profile</title>
      <link>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890830#M99218</link>
      <description>ok,&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;remember to "export cvs" after defining it.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Nov 2006 15:29:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890830#M99218</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2006-11-01T15:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: function defined in /etc/profile</title>
      <link>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890831#M99219</link>
      <description>&amp;gt;System Administrator: remember to "export cvs" after defining it.&lt;BR /&gt;&lt;BR /&gt;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.)&lt;BR /&gt;And you can't have #!/bin/ksh at the start of the script.</description>
      <pubDate>Wed, 01 Nov 2006 22:11:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890831#M99219</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2006-11-01T22:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: function defined in /etc/profile</title>
      <link>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890832#M99220</link>
      <description>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.</description>
      <pubDate>Wed, 01 Nov 2006 22:33:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890832#M99220</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2006-11-01T22:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: function defined in /etc/profile</title>
      <link>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890833#M99221</link>
      <description>&amp;gt;Bill Hassell: A more portable solution ...&lt;BR /&gt;&lt;BR /&gt;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.</description>
      <pubDate>Thu, 02 Nov 2006 02:50:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890833#M99221</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2006-11-02T02:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: function defined in /etc/profile</title>
      <link>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890834#M99222</link>
      <description>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.&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Nov 2006 08:43:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/function-defined-in-etc-profile/m-p/3890834#M99222</guid>
      <dc:creator>Tammy Liang</dc:creator>
      <dc:date>2006-11-02T08:43:16Z</dc:date>
    </item>
  </channel>
</rss>

