rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: John (Most modern computers would break if you stood on them) Mackin <john@ civil.su.oz.au>
To: The rc Mailing List <rc@hawkwind.utcs.toronto.edu>
Subject: backquote poser
Date: Tue, 9 Mar 1993 06:32:13 -0500	[thread overview]
Message-ID: <199303092132.8960.rc.baful@civil.su.oz.au> (raw)

I was just writing an rc script where I wanted to assign a variable
the value of the output of the "domainname" command.  This command
might not be present on the system the script is being run on; if not,
I wanted the variable assigned the null list, and for no error message
about domainname not being found to be echoed onto the script's
standard error.  The best thing I could come up with was:

	domain = ` { exec >[2] /dev/null; domainname }

Anyone got a cleaner idea?  For some reason it seems to me it should
be able to be done more neatly.  I guess I mainly don't like needing
a semicolon.

OK,
John.


             reply	other threads:[~1993-03-09 11:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-03-09 11:32 John Mackin [this message]
1993-03-09 12:13 ` mycroft
1993-03-09 12:28 Icarus Sparry

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=199303092132.8960.rc.baful@civil.su.oz.au \
    --to=john@civil.su.oz.au \
    --cc=rc@hawkwind.utcs.toronto.edu \
    /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).