functions in

hi
could anybody please suggest me how to put a function memory for particular user.
say i am a user rao. want have a function foo in memory .

i have done this .typed the function function in the shell it worked for the session.but next time i do login its not there .

i can i have a function forever in memory.

You will need to put it in you environment setup files. These depend on you shell. but you should find which one to use by looking at the man page for your shell and searching for FILES.

i am using kshell

In .profile add

foo()
{
     ls "$1" 
}

save the file.
next time you login try executing the function:

> foo somefilename
somefilename

If you login

thanks Jim.

but writing all the function in .profile looks no good i think.
i am lookin for a sophisticated way of writing functions probably the ENV file.

but not much aware of ENV file , if anybody knows please let me know.

What's wrong with jim's answer? Did you try to do it and did it fail?

The env that you are talking about is the environment of your process, and that is not kept in any file, but in memory. Once a process ends, its environment is lost as well. To make the function persistent across sessions, you have to define it somewhere and that somewhere is your .profile.

[quote=blowtorch]
What's wrong with jim's answer? Did you try to do it and did it fail?

No wrong with Jims answer . i know it ll work.
i am working on a server where in i have functions ,they are put through some other way .basically i am lookin for the other way around.
i tried FPATH is also working.but donno how to do it using ENV files.