From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from natalie.ibmpcug.co.uk ([192.68.174.66]) by hawkwind.utcs.toronto.edu with SMTP id <2703>; Tue, 30 Jun 1992 09:52:57 -0400 Received: by natalie.ibmpcug.co.uk id aa13821; 30 Jun 92 14:48 BST Received: from kate.ibmpcug.co.uk by natalie.ibmpcug.co.uk id aa10439; 30 Jun 92 9:34 BST X-Phone-Work: +44 81 863-1191 X-Fax-Work: +44 81 863-6095 X-Favourite-Colour: black, of course. Newsgroups: list.rc In-Reply-To: <9206300655.AA09921@redvax.mimosa.com> Organization: The IBM PC User Group, UK. X-Mailer: Mail User's Shell (7.1.2 7/11/90) To: hugh@mimosa.com Subject: Re: -s flag Cc: rc@hawkwind.utcs.toronto.edu Date: Tue, 30 Jun 1992 04:26:46 -0400 From: Matthew Farwell Sender: dylan@ibmpcug.co.uk Message-ID: <9206300926.aa22582@kate.ibmpcug.co.uk> In article <9206300655.AA09921@redvax.mimosa.com> you write: >| From: John (_You_ hide, they seek.) Mackin >| 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 >| >| 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