On Sat, Aug 9, 2025 at 6:07 AM Dan <d...@nnnne-o-o-o.com> wrote:
>
> You can find a prerelease here:
> https://github.com/par7133/syscleandoc
>
> Too tired, I will continue working on this tomorrow..
>
> Waiting for any suggestion..

Ok I'll bite:

Minor, easy:
- I would want to see a few lines in the README telling me what the
tool does, or what problem it solves. Right now it's not clear why I
would want to use it.
- The tool is overly verbose, I wouldn't print anything at all at
startup, and remove all the empty lines.

Important:
They way you use ".cache" and sysclean.out will cause problems and annoyances.
- First of all, none of the files you create are anything like cache
files. You abuse it as some kind of "temp". That's what /tmp/ is for.
- It appears that you will eventually create more than one file there,
which will pollute everything. If you insist of using .cache, then
create a subdirectory.
- Don't hardcode ".cache", use $XDG_CACHE_DIR environment variable,
then fallback on .cache
- ... but the *correct* way is to use "mktemp -d" and use that
directory for all your files, then delete the directory at exit. That
way, multiple runs of your tool by the same user doesn't break, the
tool is faster if /tmp is on a ramdisk or faster storage, accidental
leftover files can be cleaned by the system, etc.

General:
Any tool to parse the output of other tools is probably a lot easier
and safer to write in perl. For example, I won't comment on shell
quoting and security because whenever I'm in the situation where it
matters in a shell script, I stop and reconsider, and usually move to
a more suitable tool.

Reply via email to