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
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".
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.
Summary: Hi: The Korn shell automatically loads a function the first time it's called provided the function resides in a directory in the shell variable FPATH (the format of FPATH is the same as PATH), and the...
Summary: I am porting a Korn shell from Solaris to AIX. The script has a bunch of function calls. One of the function within the script returns the script name by using $0. This works fine on Solaris. But on A...
Summary: I have written a script to login to various network equip and perform automated functions. Is there a way to hide the input from the keyboard on read in Korn shell. read USER?"UBR Login:" read PASS?"...