小编Lin*_*xon的帖子

查找文件并执行命令

我有很多rar档案在单个文件夹中构建,并希望脚本解压缩它们.

我无法弄清楚它应该如何完成并需要一些帮助.

#!/bin/bash
## For all inodes
for i in pwd; do
    ## If it's a directory
    if [ -d "$i" ] then
        cd $i

        ## Find ".rar" file
        for [f in *.rar]; do
            ./bin/unrar x "$f" # Run unrar command on filename
            cd ..
        done
    done
done
Run Code Online (Sandbox Code Playgroud)

我不熟悉bash脚本,我认为代码错误不止一次.但我想这应该是基本结构

linux bash

11
推荐指数
2
解决办法
1万
查看次数

继承中的Java内存使用情况

扩展基类时,Java中的内存使用情况如何?

子类是否包含基类的实例(具有它自己的开销和所有)或它是否只有16字节的开销?

class Foo {
 int x;
}

class Bar extends Foo {
 int y;
}
Run Code Online (Sandbox Code Playgroud)

那么,更具体地说,Bar实例的内存使用量是多少?

是吗 Foo (including overhead) + Bar(including overhead)

要不就 Foo (excluding overhead + Bar(including overhead)

java memory inheritance subclass

9
推荐指数
1
解决办法
1382
查看次数

标签 统计

bash ×1

inheritance ×1

java ×1

linux ×1

memory ×1

subclass ×1