rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* Re: Adding the '-s' flag?
       [not found] <9206171300.AA13571@earth.osf.org>
@ 1992-06-17 13:01 ` John Mackin
  0 siblings, 0 replies; 3+ messages in thread
From: John Mackin @ 1992-06-17 13:01 UTC (permalink / raw)
  To: The rc Mailing List

I have been carrying on a discussion with Rich about the -s flag, and he
made the following comment:

     I would like a version of script that took a commandline to run; wold
    be useful at times.

More and more and more I am so excruciatingly glad that I changed over to
rc when I did.  Sure, the quoting is clean, sure, we have confidence in
interactive constructs because we understand the grammar, but never mind
all that!  The biggest reason to use rc is, it just pays off again and
again in total functionality!!  If you have a shell which is sophisticated,
powerful, understandable _and_ lacking in `dark corners,' well, you really
can accomplish anything.

You want script to be able to run a command?  Absolutely too easy!  Don't
change the real script, just install this (which I just wrote but have
tested) in $path in front of it, called script.  Giving it a usage
compatible with real script (-a for append, supply script filename)
is left as an exercise for the reader.

[By the way Rich: unless your version of script has powers and abilities
far beyond those of mortal versions, why not trash it and render the -s
question moot?]

OK,
John.

#!/full/path/to/rc

SHELL = /full/path/to/rc	# if you think anyone will run it with $SHELL
				# set otherwise
if ( ! ~ $#* 0 ) eval fn prompt '{' $* ';' exit '}'
exec /full/path/to/real/script


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Adding the '-s' flag?
  1992-06-15 18:53 rsalz
@ 1992-06-15 19:50 ` Scott Schwartz
  0 siblings, 0 replies; 3+ messages in thread
From: Scott Schwartz @ 1992-06-15 19:50 UTC (permalink / raw)
  To: rsalz; +Cc: rc


| I'd like to add the -s flag supported by sh and csh.
| It reads from stdin; all other command-line parameters get set into $*.

How about:

; rc -i /dev/fd/0 foo bar
; echo $*
foo bar

(Achieved on SunOS with some shared library hackery... Doesn't OSF/1
have /dev/fd builtin?)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Adding the '-s' flag?
@ 1992-06-15 18:53 rsalz
  1992-06-15 19:50 ` Scott Schwartz
  0 siblings, 1 reply; 3+ messages in thread
From: rsalz @ 1992-06-15 18:53 UTC (permalink / raw)
  To: rc

I'd like to add the -s flag supported by sh and csh.
It reads from stdin; all other command-line parameters get set into $*.
; sh -i foo bar
sh: foo: cannot open
# [Exit 1]
; sh -s foo bar
$ echo $*
foo bar

help?


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1992-06-17 13:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <9206171300.AA13571@earth.osf.org>
1992-06-17 13:01 ` Adding the '-s' flag? John Mackin
1992-06-15 18:53 rsalz
1992-06-15 19:50 ` Scott Schwartz

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).