Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
stat返回“没有这样的文件或目录”,在javaexec下运行_Java_Bash_Exec_Stat - Fatal编程技术网

stat返回“没有这样的文件或目录”,在javaexec下运行

stat返回“没有这样的文件或目录”,在javaexec下运行,java,bash,exec,stat,Java,Bash,Exec,Stat,我想用Java调用stat,使用: 但始终获得退出代码-1和: stat: cannot stat `/*': No such file or directory 在bash中运行stat/*可以,这也可以: Runtime.getRuntime().exec("stat /") Java中的stat/*与bash中的行为不同吗?stat/*在命令行中工作,因为shell解释*。 您应该尝试运行bash,例如,bash-cstat/* Runtime.getRuntime().exec("s

我想用Java调用
stat
,使用:

但始终获得退出代码-1和:

stat: cannot stat `/*': No such file or directory
在bash中运行
stat/*
可以,这也可以:

Runtime.getRuntime().exec("stat /")

Java中的
stat/*
与bash中的行为不同吗?

stat/*
在命令行中工作,因为shell解释
*
。 您应该尝试运行bash,例如,
bash-cstat/*

Runtime.getRuntime().exec("stat /")