My Workday

Let's talk TECH
  • Home
  • Contact Information – ご質問・問い合わせ

Archive

Posts Tagged ‘AWK’

Using Shell Variables with AWK

June 21st, 2008 No comments

Pattern matching example:

?View Code BASH
1
awk '/foo1/ && /foo2/ { print $1 }'

To use shell variables simply do the following:

?View Code BASH
1
2
3
4
foo1={pattern1}
foo2={pattern2}
 
awk "/$foo1/ && /$foo2/"'{ print $1 }'
RSS

Tags

AWK Bitwise Operation BogoMips Chrome Constractor Crontab Drop Caches G1 hash Humor J2EE Japan Linux MySQL Out of Memory performance ps regex song strace SVN swap tmpfs Unix Upgrade MySQL vi

Helpful?


Categories

  • Google
  • Humor
  • J2EE
  • Japan
  • Java
  • Linux
  • MySQL
  • Profiling
  • regex
  • SVN
  • Uncategorized
  • Unix

Blogroll

  • Aikido
  • DISKSTROYER™
  • Komine – Tokyo
  • OnePerfectCake

Archives

  • February 2012
  • June 2011
  • May 2011
  • February 2011
  • October 2010
  • September 2010
  • March 2010
  • February 2010
  • December 2009
  • July 2009
  • June 2009
  • May 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • October 2008
  • September 2008
  • August 2008
  • June 2008

Meta

  • Log in
Copyright © 2008-2012 My Workday