1. Genki Sugawara
  2. ruby-mawk

Source

ruby-mawk /

Filename Size Date modified Message
ext
lib
52 B
94 B
474 B
525 B
= ruby-mawk

== Description

Ruby binding for libmawk

see http://repo.hu/projects/libmawk/

== Install

gem install mawk

== Example

  #!/usr/bin/env ruby
  
  require 'mawk'
  
  open('file.txt') do |f|
    f.awk('/London/ {print}')
  end
  
  str = <<-EOS
    London Bridge is broken down,
    Broken down, bloken down.
    London Bridge is bloken down,
    My fair lady.
  EOS
  
  #puts str.sawk('{print $2}')
  
  str.sawk('{print $2}') do |line|
    puts line
  end