generic/386: Fix _filter_quota_rpt
authorKusanagi Kouichi <slash@ac.auone-net.jp>
Sun, 1 Dec 2019 12:52:58 +0000 (21:52 +0900)
committerEryu Guan <guaneryu@gmail.com>
Sun, 8 Dec 2019 14:19:29 +0000 (22:19 +0800)
It outputs nothing because of awk errors.

Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/386

index 462c586976cfdc8da0229e815a0813c06aaa8745..0c44c80e22c2ac0203bc3930542c1cb6e7647d65 100755 (executable)
@@ -63,7 +63,7 @@ _require_scratch
 # interested in contains our project name in the first field.  For "df"
 # it contains our project directory in the last field.
 # But if the device name is too long, the "df" output is broke into two
-# lines, the fourth field is not correct, so take $(nf-2) of "df"
+# lines, the fourth field is not correct, so take $(NF-2) of "df"
 _filter_quota_rpt() {
        awk '
        BEGIN {
@@ -84,12 +84,12 @@ _filter_quota_rpt() {
                return result;
        }
        {
-               if ($1 =~ proj_name) {
+               if ($1 ~ proj_name) {
                        # this is the "report" output
                        bsize = byte_size($4);
-               } else if ($nf =~ proj_dir) {
+               } else if ($NF ~ proj_dir) {
                        # this is the "df" output
-                       bsize = byte_size($(nf-2));
+                       bsize = byte_size($(NF-2));
                } else {
                        next;
                }