zli5t / ShellQDB

A quote database implemented entirely in shell.
2 stars 0 forks source link

showqf #17

Open ethanjli opened 14 years ago

ethanjli commented 14 years ago

Regarding showqf: say you want to do "showqf -f u -s gt 10". The only way I can think of to implement this "multiple filters act on the input at once" thing is to store the input into a variable, then do PROCESSED=printf "%s\n" "$INPUT" | awkstuffgoeshere Is this the best way to do it?

By the way, I've modified showqf to allow such commands as "showqf f" without parameters, so if you have one PHP command (e.g. $output = shell_exec("cat quotes | showqf f " . $flagcriterion . " | showqf s " . $scorecomparisonoperator . " " . $scorecriterion)) where any of the variables in the shell_exec string can be blank, it'll handle it as expected. For example, cat quotes | showqf f a | showqf s is equivalent to cat quotes | showqf f a