Date: Thu, 26 Mar 1998 09:33:57 +0200 (EET) From: Ruslan Ermilov <ru@ucb.crimea.ua> To: jacques@wired.ctech.ac.za (Jacques Hugo) Cc: questions@FreeBSD.ORG (FreeBSD Questions) Subject: Re: awk and ' Message-ID: <199803260733.JAA13943@relay.ucb.crimea.ua> In-Reply-To: <3519E60E.52BFA1D7@wired.ctech.ac.za> from "Jacques Hugo" at "Mar 26, 98 07:22:22 am"
next in thread | previous in thread | raw e-mail | index | archive | help
Once Jacques Hugo wrote:
> Ruslan Ermilov wrote:
> >
> > Once Jacques Hugo wrote:
> > > Hi there ...
> > >
> > > How do you print the ' character in awk.
> >
> > # echo "Does what you want" | awk '{ print "\x27" }'
> > '
>
> Thanks, that did the trick.
You, probably, tried to issue smth like this, yeah?
# echo xxx | awk '{ print "\'" }'
This won't work, because according to sh(1):
* Single Quotes
* Enclosing characters in single quotes preserves the literal mean-
* ing of all the characters (except single quotes, making it impos-
* sible to put single-quotes in a single-quoted string).
By the way, the following also works:
# echo ok | awk "{ print \"'\" }"
'
--
Ruslan Ermilov System Administrator
ru@ucb.crimea.ua United Commercial Bank
+380-652-247647 Simferopol, Crimea
2426679 ICQ Network, UIN
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199803260733.JAA13943>
