["aaa"] ["bbb"]
から [""] を取り除く
Perlの場合
(strip.pl)
#!/usr/bin/env perl while(<>){ chomp; s/\[\"(\S+)\"\]/$1/; print $_,"\n"; }
$ cat a.txt | ./strip.pl aaa bbb
Rubyの場合
(strip.rb)
#!/usr/bin/env ruby STDIN.each do |line| line.gsub!(/\[\"(\S+)\"\]/,'\1') puts line end
$ cat a.txt | ./strip.rb aaa bbb