News for hackers. Stuff that matters.
Re:Show HN: DontBeEvil.rip: Search, for developers (API, exp... by mananaysiempre on Thursday March 03, 2022 @04:53PM (#30547540)
The single quotes probably need to be double ones in the last argument to permit parameter expansion, and the $@ (separately quote every argument if quoted) probably wants to be a $* (quote the entire space-separated argument array if quoted)? There’s also the grammar quirk where the last command inside braces (but not parens) needs a semicolon or newline to separate it from the brace itself. Thus:

  rip() { curl -G -H 'Accept: text/plain' --url https://dontbeevil.rip/search --data-urlencode "q=$*"; }
(tested).

I still support the point that there is no reason for this to be a (grammar-defying) alias rather than a (tame) shell function or even a separate script.

There are no comments on this comment yet.