Computing.Net > Forums > Unix > Korn shell function export

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Korn shell function export

Reply to Message Icon

Name: Iyappan
Date: October 13, 2003 at 03:18:15 Pacific
OS: SUN
CPU/Ram: Intel P3
Comment:

I have a function inside a file. THe function name and filename is different.
THis function works well, if I run it in the same shell. But if I put it in ascript and call ./function name, it says "Function name not found". I use "typeset -f" in the shell and it shows the function as one of the entries. But when I try to use the same "typeset -f" in he script, it does not show any function name.
1)Things I tried unsuccessfully to rectify the issue:
1)used "typeset -fx <function name>"
2) used "typeset -fx <Filename>"
3) Tried putting a FPATH variable pointing to the directory the function is present and then executing the command.
4) Using autoload command for both "filename and function name".



Sponsored Link
Ads by Google

Response Number 1
Name: Jerry Lemieux
Date: October 13, 2003 at 20:05:39 Pacific
Reply:

Put your function(s) into a separate shell script and source them.

. ./my_functions.ksh



0

Response Number 2
Name: Iyappan
Date: October 13, 2003 at 22:38:39 Pacific
Reply:

It works perfectly fine after I source the file as you said. The functions need not be put into a seperate shell script. The script which holds the function and also other commands could be sourced.

Thank you very much.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Korn shell function export

Functions in korn shell www.computing.net/answers/unix/functions-in-korn-shell/5022.html

AIX Korn shell www.computing.net/answers/unix/aix-korn-shell/4916.html

Read in Korn Shell www.computing.net/answers/unix/read-in-korn-shell/5141.html