mac OSX Mojaveのコマンド群
アップデートしてからブラウザもレインボーアイコンだらけでどうも調子が悪いですが、
LPIC1の勉強のこの歳になって始めたりしてます。
MacOSX標準のコマンドでも知らないのが多くて、毎日少しずつ使いかたを覚えていこうかと。
Homebrewも使ってるので標準以外のコマンドもう多そうですが一歩一歩。
手始めに/usr/binから
$ ls -l a* |more
としてアルファベット順に。
a2p*
a2p5.18*
actool*
addftinfo*
afclip*
すでに使ったことないのしかないぞ。
a2p → awkスクリプトをperlスクリプトに変換するコマンド
使い道がさっと思いつかないけど、awkはかけるけど、perlはかけないよ、
という人にとって便利なのかな。
試してみる。
hoge.awkを作り、
以下のように記載
awk -F" " '{print $1, $NF}' list.txt
何らかの空白で区切られたテキストから最初と最後だけ持ってるくる単純な処理
これをa2pに投入する
$ a2p hoge.awk
#!/usr/bin/perl
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
# this emulates #! processing on NIH machines.
# (remove #! line above if indigestible)
eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_0-9]+=)(.*)/ && shift;
# process any FOO=bar switches
$, = ' '; # set output field separator
$\ = "\n"; # set output record separator
while (<>) {
chomp; # strip record separator
@Fld = split(' ', $_, -1);
if (($awk - $F) . ' ') {
print $Fld[(1)-1], $Fld[($#Fld+1)];
}
print $_ if $list . . $txt;
}
こんな大量スクリプトがでてきた。
あまりawkスクリプトを書かないので、どう使えるか思案中。
a2p5.18はa2pの派生(バージョン違い)
actoolはXcode用のコマンドらしく、
明日は
addftinfo。
LPIC1の勉強のこの歳になって始めたりしてます。
MacOSX標準のコマンドでも知らないのが多くて、毎日少しずつ使いかたを覚えていこうかと。
Homebrewも使ってるので標準以外のコマンドもう多そうですが一歩一歩。
手始めに/usr/binから
$ ls -l a* |more
としてアルファベット順に。
a2p*
a2p5.18*
actool*
addftinfo*
afclip*
すでに使ったことないのしかないぞ。
a2p → awkスクリプトをperlスクリプトに変換するコマンド
使い道がさっと思いつかないけど、awkはかけるけど、perlはかけないよ、
という人にとって便利なのかな。
試してみる。
hoge.awkを作り、
以下のように記載
awk -F" " '{print $1, $NF}' list.txt
何らかの空白で区切られたテキストから最初と最後だけ持ってるくる単純な処理
これをa2pに投入する
$ a2p hoge.awk
#!/usr/bin/perl
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
# this emulates #! processing on NIH machines.
# (remove #! line above if indigestible)
eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_0-9]+=)(.*)/ && shift;
# process any FOO=bar switches
$, = ' '; # set output field separator
$\ = "\n"; # set output record separator
while (<>) {
chomp; # strip record separator
@Fld = split(' ', $_, -1);
if (($awk - $F) . ' ') {
print $Fld[(1)-1], $Fld[($#Fld+1)];
}
print $_ if $list . . $txt;
}
こんな大量スクリプトがでてきた。
あまりawkスクリプトを書かないので、どう使えるか思案中。
a2p5.18はa2pの派生(バージョン違い)
actoolはXcode用のコマンドらしく、
明日は
addftinfo。
2019-03-22 23:53
nice!(0)
コメント(0)
コメント 0