4 ms·
Where do you draw the line as "large"? I just threw out a few hundred lines of Python in exchange for ten lines of bash script + cron job to automate nightly a
by cushychicken 5y ago
Where do you draw the line as "large"?
I just threw out a few hundred lines of Python in exchange for ten lines of bash script + cron job to automate nightly app updates. Way easier to get working, way less painful to debug.
I grant, however, that it's not particularly large. What is?
- snidane 5y agoWhat Python is to Java, Bash is to Python. Many simple file and data munging tasks can be done on cli 100x faster with 10x less code than Python, using rudimentary bash-fu. I already see a wave of Python undoing in the data world. Python becoming the cobol of this field.
- cushychicken 5y agoI just learned about rev; rev plus cut could have saved me years of writing one off Python scripts to cut out the exact variable I need, haha rudimentary bash-fu I wish there were some guides on how to get past rudimentary bash-fu. My bash text munging is still pretty rudimentary. I'd love to get to journeyman text smash status.
- snidane 5y agoYou might want to check out 'hck' to replace 'cut'. https://github.com/sstadick/hck https://github.com/sstadick/hck
- cushychicken 5y agoI may give it a try - I have a bias to stuff that comes preinstalled, though, as I know I'll always have the chance to use it on a stock linux box.
- Hizonner 5y agoSo your 10 lines of bash use a bunch of other programs to do almost all the work, right? So what you need is a good language that lets you concisely express ways of calling out to other programs. Not necessarily a language that's backward-compatible with whatever seemed like a good idea for a CLI in 1979.
- cushychicken 5y agoNot even a bunch. It's calling a scraper written in Python, date to add some timestamps, git to add new db entries and push to version control, and touch to reload the webapp. All that in... (goes off to wc -l the script) ...twenty lines of bash, a third of which are comments. > language that lets you concisely express ways of calling out to other programs Seems like bash meets those requirements to me, dawg. /shrug
- Hizonner 5y ago... but you cut off the word "good"... :-)
- cushychicken 5y ago"Good enough" is good in my book, and bash is good enough for me. Still wish someone would give me an idea of what "large" means in bash scripts.
- HKH2 5y agoCan you recommend any modern glue languages with the following attributes? - concise (another operator instead of '|' is fine, but no extra parentheses, quotes etc.) - performant (at least as fast as Bash) - standalone (extensions discouraged)
- BiteCode_dev 5y agoWhen you start to need error handling.
- cushychicken 5y ago...unix return codes? Sorry even I can't say that with a straight face XD