lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] [lmi-commits] master 0d8f53e 02/18: Resolve shellcheck "SC1117


From: Greg Chicares
Subject: Re: [lmi] [lmi-commits] master 0d8f53e 02/18: Resolve shellcheck "SC1117" warning
Date: Mon, 3 Jun 2019 22:08:12 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 2019-06-03 20:50, Vadim Zeitlin wrote:
> On Thu, 30 May 2019 13:19:26 +0000 Greg Chicares <address@hidden> wrote:
> 
> GC> In exchange for restricting myself to the subset of 'sh' code that
> GC> shellcheck accepts without warning, I get notified automatically
> GC> of some mistakes, before I even commit them. For me, that's a good
> GC> tradeoff.
> 
>  If it did find some real errors for you, then it's indeed good.

Your 'sh' skills are of a different order than mine. If 'sh' were
a bicycle, I'd need to use training wheels to prevent orthopaedic
injury. 'shellcheck' has identified real errors that I've actually
committed, or otherwise would have committed.

> But my
> problem with shellcheck is that so far I haven't seen it detect any real
> problems (some of its warnings are fair enough and _could_ result in some
> trouble if the scripts were used with unconstrained inputs, e.g. if we used
> paths with spaces in them -- but we don't, and hopefully never will)

Machinery already in lmi can and should be adapted to ban paths
with spaces--within lmi at least. OTOH, this command finds 826
offending files:

  # find / -name "* *" | less -S

'wine' is a major offender (but I guess they have no choice), e.g.:

  /REDACTED/.wine/drive_c/Program Files

So is 'chrome' (I'll just show one of many instances):

  /REDACTED/.cache/google-chrome/Default/Media Cache

and mozilla:

  /REDACTED/.mozilla/firefox/Crash Reports
  /REDACTED/.icedove/REDACTED/Mail/Local Folders/Unsent Messages

and KDE, and xfce (or gnome), and even the kernel:

  /REDACTED/.local/share/konsole/Profile 2.profile
  /REDACTED/.local/share/Trash/files/New Folder
  /sys/bus/pnp/drivers/i8042 aux

and of course msw users often send me files with spaces in
their names.

This one must have been a redirection gone awry:

  /REDACTED/opt/lmi/src/log --count | xargs printf %d

At least this command finds zero files:

# find / -name "`printf '*[\\x01-\\x1f\\x7f]*'`" -exec echo 1 \; | wc -l



reply via email to

[Prev in Thread] Current Thread [Next in Thread]