From: dexen deVries <dexen.devries@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: [9fans] p9p rc flag e +
Date: Thu, 21 Mar 2013 14:29:38 +0100 [thread overview]
Message-ID: <2197990.tSQfKsnBKJ@coil> (raw)
[-- Attachment #1: Type: text/plain, Size: 667 bytes --]
in p9p rc, an `if (/bin/false)' statement without `if not' statement causes
non-empty $status, and thus will terminate mk.
for example, the attached mkfile returns error for target `breaks', but works
for target `works', with the difference being that of trailing `if not'.
from my point of view, the `if (/bin/false)' statement spills the non-empty
$status from the conditional expression to its outern scope. perhaps this is
to simplify implementation of `if not', but it irks me.
is that really the expected behavior, or is it a quirk of p9p rc?
is there a point to, or an use case for this behavior?
--
dexen deVries
[[[↓][→]]]
[-- Attachment #2: mkfile --]
[-- Type: text/plain, Size: 324 bytes --]
MKSHELL=$PLAN9/bin/rc
test:VQ: positive negative
echo success.
positive:VQ:
if (test -e mkfile)
echo the file exists
negative:VQ:
# any file or dir that is sure not to exist
# if we have a file `mkfile', then for sure we don't have a dir `mkfile/'
if (test -e mkfile/)
echo SHOULD NOT BE REACHED
next reply other threads:[~2013-03-21 13:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-21 13:29 dexen deVries [this message]
2013-03-21 14:22 ` erik quanstrom
2013-03-21 14:58 ` dexen deVries
2013-03-21 15:27 ` erik quanstrom
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=2197990.tSQfKsnBKJ@coil \
--to=dexen.devries@gmail.com \
--cc=9fans@9fans.net \
/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.
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).