From owner-freebsd-questions Wed Mar 25 23:42:42 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA29413 for freebsd-questions-outgoing; Wed, 25 Mar 1998 23:42:42 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from relay.ucb.crimea.ua (relay.ucb.crimea.ua [194.93.177.113]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA29072 for ; Wed, 25 Mar 1998 23:38:04 -0800 (PST) (envelope-from ru@ucb.crimea.ua) Received: (from ru@localhost) by relay.ucb.crimea.ua (8.8.8/8.8.8) id JAA13943; Thu, 26 Mar 1998 09:33:57 +0200 (EET) (envelope-from ru) From: Ruslan Ermilov Message-Id: <199803260733.JAA13943@relay.ucb.crimea.ua> Subject: Re: awk and ' In-Reply-To: <3519E60E.52BFA1D7@wired.ctech.ac.za> from "Jacques Hugo" at "Mar 26, 98 07:22:22 am" To: jacques@wired.ctech.ac.za (Jacques Hugo) Date: Thu, 26 Mar 1998 09:33:57 +0200 (EET) Cc: questions@FreeBSD.ORG (FreeBSD Questions) X-My-Interests: Unix,Oracle,Networking X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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