这是我的作业练习之一。shell脚本帮助
Write a shell program, which will take a directory as an argument. The script should then print all the regular files in the directory and all the recursive directories, with the following information n the given order for each of the files File name (full name from the specified directory) file size owner In case the directory argument is not given, the script should assume the directory to be the current working directory
我对如何解决这个问题感到困惑。对于文件列表部分,我尝试了
ls -R | awk ...,但我无法做到这一点,因为我无法为awk找到合适的字段分隔符。 我知道它不公平的要求解决方案,但请你们能给我一个提示,告诉我如何解决这个问题?提前致谢。
你的意思exec命令? – CHID
没有--exec该--printf选项查找(GNU发现4.1.20,可能还有其他人)给你你需要的一切。 –
谢谢,这是有益的 – CHID