rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* Re:  Simple ' question
@ 1993-05-25 13:48 rsalz
  0 siblings, 0 replies; 5+ messages in thread
From: rsalz @ 1993-05-25 13:48 UTC (permalink / raw)
  To: bk, rc

Two quick ways:
	eval 'sed $linenumber r filename'
	sed $linenumber ^ ' r filename'


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

* Re: Simple ' question
@ 1993-05-25 15:22 Alan Watson
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Watson @ 1993-05-25 15:22 UTC (permalink / raw)
  To: rc

> Two quick ways:
> 	eval 'sed $linenumber r filename'

I don't think so.

> 	sed $linenumber ^ ' r filename'

This works.


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

* Re: Simple ' question
@ 1993-05-25 13:51 Alan Watson
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Watson @ 1993-05-25 13:51 UTC (permalink / raw)
  To: rc-owner

sed $linenumber^' r filename' otherfile

You should find this explained in the sections of the manual and Duff's
paper where variables and `careting' are discussed.  (For non-English
speakers, `to caret' is not a real English verb, rather it is one that
Duff made up and comes from the name for the `^' character.)


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

* Re: Simple ' question
@ 1993-05-25 13:41 Tim.Goodwin
  0 siblings, 0 replies; 5+ messages in thread
From: Tim.Goodwin @ 1993-05-25 13:41 UTC (permalink / raw)
  To: bk; +Cc: rc

> I would like to get this behaviour:
> 
> sed '1 r filename' otherfile
> 
> but with a $lineNumber instead of 1.

How about this?

    sed $lineNumber^' r filename' otherfile

(The caret operator is one of my favourite things about rc, especially
when used with lists.  There can't be many days go by that I don't say
something like

    cat /tmp/^(foo bar qux) | whatever
)

Tim.


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

* Simple ' question
@ 1993-05-25 13:33 Bengt KLEBERG
  0 siblings, 0 replies; 5+ messages in thread
From: Bengt KLEBERG @ 1993-05-25 13:33 UTC (permalink / raw)
  To: rc

Greetings,

I would like to get this behaviour:

sed '1 r filename' otherfile

but with a $lineNumber instead of 1.


This doesn't work:

sed ''''$lineNumber r filename'''' otherfile

Suggestions anyone?

Bengt


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

end of thread, other threads:[~1993-05-25 15:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-05-25 13:48 Simple ' question rsalz
  -- strict thread matches above, loose matches on Subject: below --
1993-05-25 15:22 Alan Watson
1993-05-25 13:51 Alan Watson
1993-05-25 13:41 Tim.Goodwin
1993-05-25 13:33 Bengt KLEBERG

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