[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[plamo:33471] Re: lsbytesum による表示について



阿部さん、こじまさん、こんにちは。

吉澤です。
お世話になっております。

勉強がてら私もやってみました。

-----------------------------
#!/bin/bash
#     lsbytesum - sum the number of bytes in a directory listing
TotalBytes=0
for Bytes in $(ls -l | grep "^-" | awk '{ print $5 }' | tr -d ',')
do
    let TotalBytes=$TotalBytes+$Bytes
done
TotalMeg=$(echo -e "scale=3 \n$TotalBytes/1048576 \nquit" | bc)
echo -n "$TotalMeg"
-----------------------------

trコマンドで','を取り除いて見たのですが、
動いているのかな?

$ ls -lF
合計 146,714,624
-rw-r--r--  1 takahiro users       1,394 11月  2日  22:29 README.txt
-rw-r--r--  1 takahiro users 146,700,885 10月 30日  17:51 initrd.img
lrwxrwxrwx  1 takahiro users          11 10月 30日  17:51 linux -> linux-5.9.1/
drwxr-xr-x 25 takahiro users       4,096 11月  3日  00:07 linux-5.9.1/
drwxr-xr-x 16 takahiro users         182 10月 30日  16:06 qemu_root/
-rw-r--r--  1 takahiro users         479 10月 30日  17:24 start.sh
$ sh ~/lsbyte
139.906


On Tue, Nov 03, 2020 at 11:46:00PM +0900, KOJIMA Mitsuhiro wrote:
> 
> こじま@linux-5.10がLTS候補だそうで調べてみているのだけど、
>    5.9 あたりからvt.c回りが大幅に変っていて、
>    従来のcjk-ttyパッチが使えなさそうで困っている、、です。
> 
> # cjk-tty パッチがあたるのは 5.8 までっぽい

私もこれまた勉強がてらカーネルをデバッグして題材としてvt.c見ているのですが、
かなり変わっていますね…。

-- 
Takahiro Yoshizawa


Follow-Ups
[plamo:33472] Re: lsbytesum による表示について, ABE Shin-ichi
References
[plamo:33469] lsbytesum による表示について, ABE Shin-ichi
[plamo:33470] Re: lsbytesumによる表示について, KOJIMA Mitsuhiro

[検索ページ] [メール一覧]
Plamo ML 公開システム