Re: [hackers] [farbfeld] Shellcheck 2ff fixes || FRIGN

From: Evan Gates <evan.gates_AT_gmail.com>
Date: Wed, 7 Sep 2016 15:19:23 -0700

Hey FRIGN,

I'm glad you quoted! I do have a couple questions and discussion
points I'd value your feedback on.

Why all the extraneous semicolons? I see this a lot in awk, too. I
think it tends to be a reflex for C programmers.

Why not quote "$ret"? You don't have control over the environment in
which the user will run the script. I know it sounds stupid, but I
have literally seen a script run in a case where IFS=0 and if [ $? -ne
0 ] broke. And it was a legitimate usage.

And the following purely style questions:

What are your thoughts on
FORMAT=$(file -ib "$TMP") FORMAT=${FORMAT%;*}
instead of using the file | cut? I tend towards using shell parameter
expansion instead of piping. I think I started to do so in order to
save the fork and pipe, but now it just comes more naturally to me.

I still highly recommend not using all cap variables. I'm not sure
where the trend started, I don't see it in any other language (does
pop up in makefiles).
Received on Thu Sep 08 2016 - 00:19:23 CEST

This archive was generated by hypermail 2.3.0 : Thu Sep 08 2016 - 00:24:16 CEST