我正在尝试编写一个 awk 脚本来从 ls -l 生成自定义输出,如下所示:
File xxx.txt has size of 100 blocks, was last modified on July 3 2013, is owned by Kohn. The user has read permission, has write permission and has execute permission.
Dir abc has size of 200 blocks, was last modified on July 1 2013, is owned by Kohn. The user has read permission, does not have write permission and has execute permission.
...
我发现最困难的任务是解析第一列 $1 以获取权限和文件/目录。你能给我一个提示如何解决这个问题吗?
真诚的,科恩