From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9460 invoked from network); 26 Apr 2000 20:28:00 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 26 Apr 2000 20:28:00 -0000 Received: (qmail 18103 invoked by alias); 26 Apr 2000 20:27:30 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3034 Received: (qmail 18091 invoked from network); 26 Apr 2000 20:27:29 -0000 Message-ID: <154A66C813EED311AECB00508B8B8D093F459D@iupuimbx06.uits.iupui.edu> From: "Cosgray, Nathan" To: zsh-users@sunsite.auc.dk Subject: Help with functions Date: Wed, 26 Apr 2000 15:22:19 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Hello everyone, I am trying to run a complex group of processes that at one time were all automated via make, which called functions in a zsh shell script, which in turn moved files around and ran sas scripts. All of this was written years ago by the predecessor to the predecessor to my predecessor. To my knowledge the last time they were used sucessfully was towards the end of 1998. Here is the problem that seems to be holding me back. To be as precise as possible, the makefile calls functions within a zsh script in the following manner: : ./run_masterfile_step get_file : ./run_masterfile_step get_file : ./run_masterfile_step recalcprep Etc. So, from my makefile, many different zsh functions are called to operate on many different files, according to the dependencies defined in the makefile and the parameters passed to the various functions in run_masterfile_step. The zsh script run_masterfile_step contains about 25 functions defined like so: #!/usr/local/bin/zsh ... get_file () { ... } recalcprep () { ... } Now, I have never delved too deeply into shell scripting, but from what I can gather the idea behind this is that make calls the functions defined in run_masterfile_step. In turn, the functions will perform various tasks based on the parameters they receive. In addition, these functions often call each other, in order to do things such as display the current date/time, or send an email message -- which is, I assume, partly why they must all be contained within a single file. The problem is, none of this is working. make fails due to the fact that none of the functions provided by run_masterfile_step actually do anything. To experiment from the command line, I can type './run_masterfile_step ' and nothing will happen (obviously I have closely examined the functions and I'm including valid parameters, referring to files that exist, etc.). I get no error messges, no output (all of the functions within the zsh script use echo's extensively to give feedback), and I notice no discernable processing time. I can easily tell what is supposed to happen from the script code but none of it is in fact happening. I can do a 'source run_masterfile_step' and then type '' and it will work properly, however. So I'm thinking there must be a problem with the way in which these functions are called. Unfortunately, I can't find any documentation that describes the syntax and rules for this. Does this problem have anything to do with the fact that these functions are indirectly called from make vs. from within zsh? Should these functions be split up into separate shell scripts? We currently have zsh 3.0.2 installed on SunOS 5.5 and 5.6 (varies by machine). I also compiled zsh 2.5.03 but it did not work as expected with these scripts, either. I have no way of knowing what version of zsh orginally ran these scripts years ago. I do know that they were used sucessfully for quite some time -- at least 3 years ending in November of 1998. I believe there have been some hardware and software upgrades since then but I'm not sure what could cause these scripts to break in such a fundamental way. I'm sure that I can rewrite or reorganize these scripts if I need to. But I'd just like to make sure there is nothing I can do to easily fix this. I'm also extremely confused about why this would no longer be working the way it was written. There must be something important I'm missing and I'd like to understand what that is. So. Any ideas or thoughts? Corrections of syntax? Version conflicts? Do you need more information, like the scripts themselves? Or at the least can you tell me where to go for zsh scripting documentation more detailed and complete than the man pages or that kept on http://www.zsh.org? Your help is very much appreciated. Thanks Nathan A. Cosgray, Database Administrator IUPUI Dept. of Medical Genetics