Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

命令行参数支持 #2

Open
cairijun opened this issue Mar 2, 2015 · 0 comments
Open

命令行参数支持 #2

cairijun opened this issue Mar 2, 2015 · 0 comments

Comments

@cairijun
Copy link

cairijun commented Mar 2, 2015

  • 可以通过ls file1 file2 file2这样来指定输出哪些文件
  • 可以通过ls dir1来指定列出目录dir1中的文件
  • 可以通过ls dir1 dir2 dir3来列出多个目录下的文件
  • 可以通过ls dir1 file1 file2 file3 dir2这样来混合文件和文件夹进行输出
  • 当然这些文件名和路径可以是绝对路径,也可以是相对路径:ls ./dir1 /tmp/file1 ~/dir2
  • 支持参数的同时也要保留-l选项的支持,该选项在参数前出现:ls -l /tmp/ /usr file1
  • 通配符展开是shell自己实现的,不需要在程序中实现,比如:ls xxoo*会自动展开成ls xxoo0 xxoo1 xxoo10 xxoo11这样,不需要程序去处理

不同形式的参数下输出的格式参照标准的ls程序。

(彩色输出选做吧)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant