4 ms·
I think a common strategy (at least for me) is to make good use of Linux commands and things like Awk and Sed. If it grows more than a few lines, it's often bes
by 7thaccount 1y ago
I think a common strategy (at least for me) is to make good use of Linux commands and things like Awk and Sed. If it grows more than a few lines, it's often best to switch to something like Python, Perl, Tcl...etc.
- kjs3 1y agoThat's a (self-)discipline thing. One has to do something about "this script has become a big conky" other than default to "oh, what's another 10 lines". Which we all do.
- 7thaccount 1y agoAt some point, the clear features of modern languages far outweigh what I get out of the command line tools and Awk/Bash. For me, it doesn't take long, so it's less discipline and more not wasting my time. Your mileage may vary though.
- kjs3 1y agoIndeed. I cannot tell you how many time I've 'wasted time' on a one-line sed script or 10 lines of awk that obviously would have been better spent on several times that number of lines of a 'modern' language, that I would have to install before I could use. Terrible...something only a boomer would do, amiright. YMMV, though.
- 7thaccount 1y agoI might do the same if there isn't anything already pre installed. On most of the RHEL machines I've used there has at least been some Python or Perl interpreter installed. Maybe that was just something the IT folks did. I'm not really talking about making something longer just to be more clear either. I just meant all the nice libraries and Python data structures seem to allow me to do complex things in a short amount of code. Bash and Awk and all the Linux commands are great for simple things, but I haven't figured out how to handle more complex data outputs.