#!/bin/sh
for i in "$@"; do ... done
Nothing
This can be written more concisely and clearly as for i; do ... done
That's more clear? A for loop with an implied target? Forgive me, because I LOVE Perl, but this is not Perl. I don't think shellcheck should be in the business of playing "bash golf". And in 30+ years of coding, I have never seen this. I verified it works, but I think it's just too cute to be a desired practice. But I am not the one doing the evaluations, so good luck to you.
OK, will admit I had while; shift loops in mind when comparing, so was slightly biased when writing OP.
On September 4, 2020 4:05:39 AM GMT+03:00, "Matthew O. Persico" notifications@github.com wrote:
That's more clear? A for loop with an implied target? Forgive me,
because I LOVE Perl, but this is not Perl. I don't think
shellcheckshould be in the business of playing "bash golf". And in
30+ years of coding, I have never seen this. I verified it works,
but I think it's just too cute to be a desired practice. But I am not
the one doing the evaluations, so good luck to you.--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
https://github.com/koalaman/shellcheck/issues/2050#issuecomment-686840458
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Most helpful comment
That's more clear? A for loop with an implied target? Forgive me, because I LOVE Perl, but this is not Perl. I don't think
shellcheckshould be in the business of playing "bash golf". And in 30+ years of coding, I have never seen this. I verified it works, but I think it's just too cute to be a desired practice. But I am not the one doing the evaluations, so good luck to you.