rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: Matthew Farwell <dylan@ibmpcug.co.uk>
To: hugh@mimosa.com
Cc: rc@hawkwind.utcs.toronto.edu
Subject: Re: -s flag
Date: Tue, 30 Jun 1992 04:26:46 -0400	[thread overview]
Message-ID: <9206300926.aa22582@kate.ibmpcug.co.uk> (raw)
In-Reply-To: <9206300655.AA09921@redvax.mimosa.com>

In article <9206300655.AA09921@redvax.mimosa.com> you write:
>| From: John (_You_ hide, they seek.) Mackin <john@vetsci.su.oz.au>
>|  Hey, can anyone on the list tell us
>| all if they have any reason at all for wanting -s?  Inquiring minds
>| want to know.
>|
>| ... I will always be willing to entertain rc features
>| that keep it compatible (in appropriate ways) with traditional shells.
>
>| From: Bob Gibson <rjg@sco.com>
>|
>| My editor, jove, starts up subshells with the -s option, and obviously
>| fails to do so if the shell doesn't support it.  In this case, the
>| correct thing to do would be to fix jove to make this configurable.
>
>I am the person who made JOVE invoke subshells with the -s flag.  I
>did it in about 1984, so I have forgotten some of the subtle
>details.  I will try to reconstruct them.
>
>First, a hint from SunOS 4.0.3 sh(1):
>
>     -s             If the -s option is present or  if  no  argu-
>                    ments remain commands are read from the stan-
>                    dard input.  Any remaining arguments  specify
>                    the   positional  parameters.   Shell  output
>                    (except for Special Commands) is  written  to
>                    file descriptor 2.
>
>Actually, the story goes back to about about 1976, when I was
>hacking on ed(1).  I changed the ! command so that the shell command
>was invoked in such a way that the current file could be referred to
>as $1.  This was extremely convenient.
>	!cp -p $1 $1.BAK
>	!chmod u+w $1
>	!pr $1 | lpr
>	!diff $1.BAK $1
>
>When I started hacking on JOVE, I naturally wanted this feature
>too.  The only way that I could get it to work with csh and and all
>versions of sh was to throw in the -s.  [I don't remember which
>failed without the -s]
>
>I want to keep using this feature.  I don't want to hack JOVE to
>allow the suppression of the -s for rc.  I think it is better to
>hack rc to accept -s like other UNIX shells.

It's a lot better to fix Jove than to 'fix' rc.  You could do this like
vi/ex does it.  If I execute a subshell command in vi, then any % is
replaced by the current filename, ie

:!mv % %.bak

would be expanded to 

:!mv foo foo.bak

etc.  This is a lot better than hacking a kludge into rc for the sake of
one editor.

Dylan.

-- 
It is no coincidence that in no known language does the phrase 'As
pretty as an Airport' appear -- Douglas Adams


  reply	other threads:[~1992-06-30 13:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-06-30  6:55 "D. Hugh Redelmeier"
1992-06-30  8:26 ` Matthew Farwell [this message]
1992-06-30 15:03 "D. Hugh Redelmeier"
1992-06-30 15:29 haahr
1992-07-01 12:52 ` Gerry.Tomlinson
1992-07-01 21:14   ` Chris Siebenmann
1992-07-01 21:30 "D. Hugh Redelmeier"
1992-07-02 12:52 ` Gerry.Tomlinson
1992-07-02 14:03 Chet Ramey

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=9206300926.aa22582@kate.ibmpcug.co.uk \
    --to=dylan@ibmpcug.co.uk \
    --cc=hugh@mimosa.com \
    --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).