1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

昨日の誰得記事の続きです!

compgenでは実行できるコマンドを確認できます。
まずは、1文字のコマンドを調べてみました。

$ compgen -abck | awk 'length($0)==1{printf("%s ", $0)} END{printf("\n")}'
l . : [ { } ! l { } ! . : [ [ X w [ X w 

また、コマンドの文字数の平均は9.8文字程度でした。

$ compgen -abck | awk '{c=c+1;lc=lc+length($0)} END{ print lc/c }'
9.75687

その内訳を"文字数 個数"で出してみました。

$ compgen -abck | awk 'BEGIN{split(0,ar)} {p=length($0);ar[p]+=1} END{for(i=1;i<=37;i++){printf("%02d, %d\n", i, ar[i])}}'
01, 20
02, 110
03, 177
04, 356
05, 363
06, 445
07, 494
08, 414
09, 258
10, 243
11, 224
12, 157
13, 142
14, 122
15, 110
16, 110
17, 94
18, 80
19, 71
20, 78
21, 63
22, 37
23, 57
24, 49
25, 11
26, 29
27, 9
28, 10
29, 14
30, 11
31, 0
32, 2
33, 0
34, 2
35, 0
36, 0
37, 2

output.png

4~8文字くらいが多いようです。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?