From owner-freebsd-questions Fri Mar 15 22:14: 9 2002 Delivered-To: freebsd-questions@freebsd.org Received: from hawk.mail.pas.earthlink.net (hawk.mail.pas.earthlink.net [207.217.120.22]) by hub.freebsd.org (Postfix) with ESMTP id 2CCC837B400 for ; Fri, 15 Mar 2002 22:14:06 -0800 (PST) Received: from sdn-ar-003dcwashp305.dialsprint.net ([206.133.15.171] helo=moo.holy.cow) by hawk.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 16m7S9-0006XV-00; Fri, 15 Mar 2002 22:14:05 -0800 Received: by moo.holy.cow (Postfix, from userid 1001) id 1E6F150B83; Sat, 16 Mar 2002 01:16:23 -0500 (EST) Date: Sat, 16 Mar 2002 01:16:23 -0500 From: parv To: Mike Meyer Cc: f-q Subject: Re: /usr/bin/printf & printing escaped characters Message-ID: <20020316061622.GA21757@moo.holy.cow> Mail-Followup-To: Mike Meyer , f-q References: <20020315080839.GA18963@moo.holy.cow> <15505.45865.551648.353554@guru.mired.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15505.45865.551648.353554@guru.mired.org> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG in message <15505.45865.551648.353554@guru.mired.org>, wrote Mike Meyer thusly... > > In <20020315080839.GA18963@moo.holy.cow>, parv typed: > > i was trying to print escaped characters (\n & \t), but couldn't... > > > > # /usr/bin/printf %s "\tpolka dot\n" > > \tpolka dot\n ... > > what am i missing? > > That you can't escape characters in a string brought in via %s? > Putting the \n & \t in the format works fine for me. > > guru% printf "\t%s\n" "polka dot" > polka dot thanks mike, that did it. i would have replaced all the echo's w/ /usr/bin/printfs in my shell scripts if that had worked like the way printf works in (g)awk; now i find myself in no any particular hurry. - parv -- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message