为什么我没有得到任何输出 2024-5-15 • shell for for items in * do if [ -f items ] then echo $items fi done 看我的目录正如您所看到的,我的目录不为空,但是,当我运行上面的代码时,它没有打印任何内容。 ┌──(istiak㉿kali)-[~/ShellProgramming] └─$ ./practice.sh 答案1 谢谢@穆鲁为了他的评论。 答案如下 for items in * do if [ -f "$items" ] then printf '%s\n' "$items" fi done 相关内容 如何在 nginx 中全局将 www 重定向到非 www? 声明只能在其他命令中使用的命令 打开终端时,我自动得到这个 -- 进入 Ex 模式。输入“visual”进入正常模式。: Windows XP 中的 WebDav 系统错误 67 如果进程有响应或在一段时间后没有响应,如何停止该进程 移动服务器后锁定文件权限错误 Nvidia Gtx 750 ti 在装有 nvidia 驱动程序的 Linux 上出现延迟 使用 bash 函数处理参数 WSL 发行版中的 __USE_POSIX 和 VS Code 在不同的机器上通过 ssh 连接安装在 VMWare 中的 CentOS 机器