From: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>
To: "Allen Belk" <allen.belk@usm.edu>, <zsh-workers@sunsite.auc.dk>
Subject: RE: returning a pathname from a function
Date: Fri, 31 Mar 2000 09:47:44 +0400 [thread overview]
Message-ID: <000001bf9ad4$a30018a0$21c9ca95@mow.siemens.ru> (raw)
In-Reply-To: <000501bf9a8a$6cd33a90$3e525f83@otr.usm.edu>
> prep_directories()
> {
> output_directory="/var/adm/backup/${1}_${2}"
> backup_log="${output_directory}/backup.log"
> backup_lis="${output_directory}/backup.lis"
> return $backup_log,$backup_lis
> }
>
> prep_directories 20000330 WEEKLY
>
>
> Executing this script results in the following error.
>
> prep_directories: bad math expression: unbalanced stack [75]
>
You cannot return string. return expects arithmetic expression as
status. I agree, that message is a bit weird ... what exact vesion do
you have?
What you try to do? Either output result using echo or print builtin:
print $backup_log,$backup_lis
in this case you can do something like
DIRS=$(prep_directories 20000330 WEEKLY)
or you can set parameter explicitly in function:
DIRS=$backup_log,$backup_lis
-andrej
prev parent reply other threads:[~2000-03-31 5:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-03-30 20:56 Allen Belk
2000-03-31 5:47 ` Andrej Borsenkow [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000001bf9ad4$a30018a0$21c9ca95@mow.siemens.ru' \
--to=andrej.borsenkow@mow.siemens.ru \
--cc=allen.belk@usm.edu \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).