~/bin/tailm
とかに置く
$ cat /tmp/hoge
1
2
3
$ tailm -n 1 /tmp/hoge
2
3
#!/usr/bin/env ruby
require 'optparse'
o = OptionParser.new
o.on('-n=VAL') { |n| @n = n }
o.parse!
@n.to_i.times do
ARGF.gets
end
puts ARGF.read
Go to list of users who liked
More than 5 years have passed since last update.
~/bin/tailm
とかに置く
$ cat /tmp/hoge
1
2
3
$ tailm -n 1 /tmp/hoge
2
3
#!/usr/bin/env ruby
require 'optparse'
o = OptionParser.new
o.on('-n=VAL') { |n| @n = n }
o.parse!
@n.to_i.times do
ARGF.gets
end
puts ARGF.read
Register as a new user and use Qiita more conveniently
Go to list of users who liked