Don't overlook Bash for text processing and file handling

Story: How to use for/while/until loop in bashTotal Replies: 3
Author Content

Feb 14, 2021
4:18 PM EST
Bash and the native Unix/Linux tools (sed, awk, etc.) make it easy to process text and files. I turn to Ruby when something needs to be cross-platform, but many things involving editing text and writing and processing files is easier in Bash.

Feb 14, 2021
4:43 PM EST
It's definitely worth learning how to manipulate text and files in a scripting language like Ruby, Python or Perl, but often a Bash script is faster to create.

Feb 14, 2021
7:48 PM EST
I fell in love with Ruby several years ago and for a while used it almost exclusively as my scripting language of choice. Now I've migrated to Python mainly because of the vast library support encircling that language.

Feb 17, 2021
10:20 AM EST
I've used Perl and Python on occasion, but never Ruby. As Steven notes, there are many simple editing tasks that can be handled in Bash without utilizing other languages. For some simple tasks, you don't need any other tools; other times it is worth calling another tool from Bash; still, unless it is a complex task, doing it in Bash is simpler and often easier.

Posting in this forum is limited to members of the group: [ForumMods, SITEADMINS, MEMBERS.]

Becoming a member of LXer is easy and free. Join Us!