- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- awk and quote
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 09:39 PM
03-23-2004 09:39 PM
How do you protect the simple qote ' using awk's printf ?
I've tried using backslash, it doesn't seems to work properly ?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 09:42 PM
03-23-2004 09:42 PM
Re: awk and quote
printf "\""
-Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 09:44 PM
03-23-2004 09:44 PM
Re: awk and quote
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 09:55 PM
03-23-2004 09:55 PM
Re: awk and quote
ex:
ls | awk -F " " '{printf "\"" $1}' | tr \" \'
-Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 10:10 PM
03-23-2004 10:10 PM
Re: awk and quote
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 10:11 PM
03-23-2004 10:11 PM
Solutionawk 'END {printf("Some '\''single'\'' quoted stuff\n");}'
Thanks to,
http://lists.slug.org.au/archives/slug/2002/11/msg00086.html
-Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 10:14 PM
03-23-2004 10:14 PM
Re: awk and quote
ls | awk -F " " '{printf ("'\''''\''\n") $1}'
Too much complicated though ...!!!
-Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 10:16 PM
03-23-2004 10:16 PM
Re: awk and quote
#!/bin/sh
QUOT="'"
echo " " | awk -v quot=$QUOT '{
printf("this is a quote %s\n",quot);
}'
Regards,
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2004 10:42 PM
03-23-2004 10:42 PM
Re: awk and quote
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2004 12:10 AM
03-24-2004 12:10 AM
Re: awk and quote
This awk question :-) not yours.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=520677
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2004 02:02 AM
03-24-2004 02:02 AM
Re: awk and quote
It is a shell usage problem. The strict answer to the question is: Nothing: You do not need to protect a single quote in awk printf. Witness:
$ cat > x
BEGIN {print "test'"}
$ awk -f x
test'
Cheers,
Hein.