Quoting quotes in m4?

Quoting quotes in m4?

Post by Erik Max Franci » Tue, 30 Sep 1997 04:00:00



How do you quote forward quotes (') in m4 (specifically, GNU m4 1.4, if
that makes a difference)?  The info page for chagnequote in m4 says:

    There is no way in `m4' to quote a string containing an unmatched
    left quote, except using `changequote' to change the current quotes.

Okay, the specificity here implies that there is a way to quote the
right quote (e.g., the forward quote: '), but they don't say what it is.

Specifically, I'm interested in defining a macro that can handle forward
quotes without freaking out.  i.e.,

    foo(This macro's first argument has a quote)

and have the macro behave "correctly"; e.g., not treating the quote as
any different than any other character.

I'll be reading the group, but please copy me to email so I'll get the
response as soon as possible.  Thanks!

--

                        Alcyone Systems / http://www.alcyone.com/max/
   San Jose, California, United States / icbm://+37.20.07/-121.53.38
                                      \
   "After each war there is a little / less democracy to save."
                                    / Brooks Atkinson

 
 
 

1. Quotes in quotes

The backup command bru takes an optional Label argument like this:

bru -L "Useful label information" -cvf /dev/nst0 /dir1

In a sh script I'm writing I want to take /dir from the command line
(easy) and put it into the label field with the time. Something along the
lines of:

#!/bin/sh
DIR=$1
LABEL="$(date) $DIR"
BRUCMD="bru -L $LABEL -cvf /dev/nst0 $DIR"

echo $BRUCMD

$BRUCMD

the echo gives back exactly what I want to see:

bru -L "Fri Jun 12 20:59:42 EDT 1998 /dir1" -cvf /dev/nst0 /dir1

but when the command executes the quote marks have disappeared and bru
chokes on everything after Fri.

I'm sure this is something quite simple I'm missing, but I've already
wasted too much time on it.

Any suggestions?

thanks in advance,
Matt

2. above 38400

3. Q: sh: Can I quote '"' in a double quoted string?

4. Upgrade from SCO 5.0.4 to UnixWare 7?

5. replace single quote to double quote with an example

6. National Semiconductor DP83820 gigabit ethernet

7. quoted strings within quoted strings

8. linux on hp9000 g30 or g40?

9. Double quotes within double quotes (no apostrophes)

10. Problem in sed using double quotes and single quotes

11. to quote or not to quote?

12. quoting quotes withion a (bourne shell) script line

13. quoting quotes, problem