Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/9.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
Bash 检查文件是否可在Perl中写入_Bash_Perl - Fatal编程技术网

Bash 检查文件是否可在Perl中写入

Bash 检查文件是否可在Perl中写入,bash,perl,Bash,Perl,这个bash脚本的Perl等价物是什么 for file in * do if [ -w $file ] ; then echo $file fi done 我正在尝试查看哪些文件是可写的。这将是: 还有-w怎么样?请参见perldoc-f-w在询问此问题之前是否尝试过-w?:-)@戴夫·克罗斯,糟糕的建议。 for my $file (glob '*') { if (-w $file) { print "$file\n";

这个bash脚本的Perl等价物是什么

for file in *
do 
    if [ -w $file ] ; then 
        echo $file
    fi
done
我正在尝试查看哪些文件是可写的。

这将是:


还有
-w
怎么样?请参见
perldoc-f-w
在询问此问题之前是否尝试过
-w
?:-)@戴夫·克罗斯,糟糕的建议。
for my $file (glob '*') {   
    if (-w $file) {
        print "$file\n";
    }   
}