2 ms·
I like modularity: request_body() { cat <<REQUEST_BODY | { "from" : 0, "size" : 40 } REQUEST_
by pdkl95 13y ago
I like modularity:
request_body() {
cat <<REQUEST_BODY |
{
"from" : 0,
"size" : 40
}
REQUEST_BODY
}
get_url() {
curl http://localhost -d @-
}
request_body | get_url
I find it helps readability when you come back to it a year later. Of course, it's also easy to parameterize the body, if needed.
/readability sometimes trumps YAGNI