【发布时间】:2017-12-15 17:20:53
【问题描述】:
社区,
我希望能够将命令“isi nfs 导出列表”的输出读入脚本/程序。
然后,脚本/程序将使用输出中的数据来定位输出中的目录列表。
使用目录列表并为每一行运行 ls -lzed [DIRECTORYSTRING]。
此输出将使我能够收集每个目录的用户和组所有者是谁。
【问题讨论】:
-
你试过像
isi nfs exports list | python myprogram.py这样从标准输入获取数据 -
@theWanderer4865,这与将输出附加到文件“myprogram.py”相同吗?
标签: python command-line output ls