A related question:
9front sam has the ^ command, which makes it easy to apply multiple
sam commands to the dot from a script, e.g:

#!/bin/rc
cat << END
,x/red/ c/blue/
,x/yellow/ c/green/
END

How does one accomplish this in oldschool Unix sam -d without the ^
command, and also without using ssam?

'Here dcuments' work, because the following works fine on my shell
(Busybox sh, not rc):

$ sam -d file.txt << END
,x/red/ c/blue/
,x/yellow/ c/green/
w
q
END

However, piping dot to that script from within sam -d (using the |
command) ends up with:
sh: script.sh: not found
?warning: exit status not 0

...and also an empty (deleted) sam buffer.

Replacing 'cat' with other options, e.g. 'sam -d "$*"', eventually
gave a "broken pipe" message. And, again, in all cases, an empty
buffer.

So, no ^ command, no ssam, but want to use substitutions from 'here
documents' -- where am I going wrong?
Many thanks,
Mart

On 11/05/2022, revcomni...@gmail.com <revcomni...@gmail.com> wrote:
> Thank you! I was erring in that I failed to repeat x.

------------------------------------------
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tcf06324837558cea-M5ef5eba93c3c87f8333b2b8e
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Reply via email to