Quote:
The task as stated is simply not a reasonable thing to do. And not all combinations will be valid commands anyway, so the list would be useless without reference to the documentation, i.e. man pages of each base command. As suggested by others, make a list of man pages and/or provide a synopsis. |
Quote:
EDIT: I was going to post my calculation of combinations for the "cat" command in my previous post, but decided against it. There are 10 total options (not counting --help and --version), but 3 are essentially duplicates. You could take at most 7 at a time out of 10, which still leaves you with 120 possible combinations. |
The command syntax example in post #1 can be written as a brace expansion which will expand to a list of commands. The brace expansion in the perl bsd_glob version of glob is better for this than the one in bash because bash treats whitespace as a pattern separator.
http://perldoc.perl.org/functions/glob.html http://perldoc.perl.org/File/Glob.html Code:
# Globbing characters '*?[]~' and literal ',{}' need to be escaped with a backslash. |
Maybe use someone else's hard work and Not re-invent the wheel.
https://ss64.com/bash/ https://www.commandlinefu.com/commands/browse and if-n you're bored, https://www.commandlinefu.com/comman...-using-the-api I've read that shit 1000 times. I'm with astrogeek on this one. And they are already ubiquitously "documented" IMO. ;) Code:
man <cmd> Code:
cmd -h Code:
cmd --help All cmds on the system: Code:
compgen -c | sort -u > commands Documented in /usr/share/man/... Hope that helps. |
Quote:
|
All times are GMT -5. The time now is 02:19 AM. |