groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using .so in a macro


From: Riza Dindir
Subject: Re: using .so in a macro
Date: Thu, 16 Feb 2023 17:30:09 +0300

Hello Ralph,

I was using soelim in my pipeline (cat main.ms | soelim | pic | tbl |
groff -ms > main.ps). The problem was with soelim. I did not realize
that. I first had it with double slashes, but then tried with four
slashes... Removing soelim from the pipeline resolved the problem.

What is soelim used for? Since troff has the .so command, it must be
used for a special purpose.

Thanks.

On Thu, Feb 16, 2023 at 1:05 PM Ralph Corderoy <ralph@inputplus.co.uk> wrote:
>
> Hello Riza,
>
> > Is it possible to use the ".so" command in a macro, and pass in an
> > argument from the macro.
> >
> > .de MC
> > .so \\\\$1
> > ..
> >
> > .MC file.txt
>
> Yes.
>
>     $ cat >foo
>     .de source
>     .so \\$1
>     ..
>     foo
>     .source bar
>     foo
>     ^D
>     $
>     $ cat >bar
>     bar
>     ^D
>     $
>     $ nroff foo | grep .
>     foo bar foo
>     $
>
> You're escaping the ‘$’ too much.  You're seeing:
>
>     $ nroff foo | grep .
>     troff: foo:5: can't open '\$1': No such file or directory
>     foo foo
>     $
>
> --
> Cheers, Ralph.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]