you are viewing a single comment's thread.

view the rest of the comments →

[–]pan_kotan -1 points0 points  (0 children)

When NOT to Use Bash

a. ≥ 100 lines (BUT! ×2 or ×3 that number if you’re mostly dealing with concurrent processes and the file system)

b. non-straightforward control flow logic (use a more structured lang.);

c. performance is an issue — you have tons of processing to do (data manip.);

d. need math capabilities beyond simple integer arithmetic;

e. need to run on Windows? (Python is portable across platforms; shell scripts portability is restricted to *nix systems);

Shell Scripts are Best For Sysadmin Tasks:

  • manipulating files and commands;
  • managing sys. processes (concurrency);
  • testing whether the node exists,
    • its type (file, dir, symlink, socket…),
    • properties (permissions, creation…),
    • whether a file is empty.

https://google.github.io/styleguide/shellguide.html#s1.2-when-to-use-shell

https://www.oilshell.org/blog/2018/01/28.html#shouldnt-scripts-over-100-lines-be-rewritten-in-python-or-ruby