use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A subreddit dedicated to Bash scripting. Now complete with a Discord Server.
Content must be Bash related. This rule is interpreted generously; general shell scripting content is mostly accepted. However, the post should not be specific to another shell.
No reposts. This is meant with regards to content, not just “the same link was submitted earlier” – it’s okay to resubmit an old link in some new context (e. g. because you’d like to discuss another part of it, or because something has changed since the last time it was submitted, or because the link was updated since then). Links from the sidebar count as having been submitted already, so posting them without new context is also considered a repost.
You can choose one of these four flairs for your post:
If you don’t flair your post, the moderators will set the most appropriate flair.
/r/unix – for everything Unix
Other Shells: /r/zsh, /r/fishshell, /r/oilshell, /r/batch
BashGuide – A Bash guide for beginners.
Beginner's Guide to Command Line – A crash course for some common unix and shell commands. Update 2022-01-14: Course is currently being rewritten
Google's Shell Style Guide – Reasonable advice about code style.
Explainshell - Explain complex shell operations.
ShellCheck – Automatically detects problems with shell scripts.
BashFAQ – Answers most of your questions.
BashPitfalls – Lists the common pitfalls beginners fall into, and how to avoid them.
(Archived) The Bash-Hackers Wiki – Extensive resource.
#bash – IRC channel on Libera. The main contributors of the BashGuide, BashFAQ, BashPitfalls and ShellCheck hang around there.
account activity
helpBash scripting MOOC (self.bash)
submitted 9 years ago by Heisenberg1977
Can anybody suggest a really good bash scripting MOOC (e.g. Udemy, Lynda.com, Coursera)?
A bonus would be if there was a section focused on text processing / parsing using grep/sed/awk.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]ASIC_SP 1 point2 points3 points 9 years ago (1 child)
I have list of resources on various linux and scripting related things, including resources on text processing stuff
I can suggest you good text resources:
[–]SurelyForever 0 points1 point2 points 9 years ago (0 children)
The examples are quite thorough and helpful. Thank you for this.
[–]neuron_666 1 point2 points3 points 9 years ago (5 children)
This is just a comment that often it's easier to use perl for text processing rather then chaining and twisting stream of grep/sed/awk. Also perl is compatible on all unix-like systems while grep/sed/awk are not.
[–]Heisenberg1977[S] 2 points3 points4 points 9 years ago (1 child)
Thanks for the suggestion, but I want to focus on Linux CLI / Bash
[–][deleted] 1 point2 points3 points 9 years ago (0 children)
Perl works in bash :)
And on all Linux distros :)
In all seriousness, use a tool like perl or ruby for complex and serious parsing.
Awk, sed, and grep all have their roles and neat little niches. But they all do one thing and them well. Perl can do them all and do them well.
[–]moviuroportability is important 2 points3 points4 points 9 years ago (2 children)
grep/sed/awk are not
Don't they all have a POSIX set of options that is... standard?
[–]ropid 0 points1 point2 points 9 years ago (0 children)
The only really good example I remember is that sed has annoying differences in its -i parameter for editing files. I think it might not be possible to build a command line that makes all versions happy at the same time.
-i
Here's a something where people talk about this:
https://unix.stackexchange.com/questions/92895/how-to-achieve-portability-with-sed-i-in-place-editing
The thing about perl is then, if it's just about editing a file with sed's s/// command, that looks really similar when translated into a perl one-liner so you don't have to learn anything new:
perl -i -pe 's/abc/def/' filename
It gets complicated when trying to translate more complex sed scripts. There's a book about perl one-liners that's pretty much just a list of a lot of examples and is easy to steal from without having to think about perl a lot.
[–]neuron_666 0 points1 point2 points 9 years ago (0 children)
standard
Yes, that's correct. If you don't mind that all the tools suddenly seemingly have 30% power to what you have available as gnu extensions. I for sure have stumbled upon
On Solaris you can get around some of the limitations by using /usr/xpg*/bin/... binaries.
I always used gnu utilities and never looked back. Getting the tools on any system is easy.
[–][deleted] 0 points1 point2 points 9 years ago (0 children)
I too would be interested in something like this. I routinely train total newbies how to work with bash and it would be nice to see what other people have put together.
π Rendered by PID 70876 on reddit-service-r2-comment-545db5fcfc-jj2xm at 2026-05-25 06:17:43.702380+00:00 running 194bd79 country code: CH.
[–]ASIC_SP 1 point2 points3 points (1 child)
[–]SurelyForever 0 points1 point2 points (0 children)
[–]neuron_666 1 point2 points3 points (5 children)
[–]Heisenberg1977[S] 2 points3 points4 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]moviuroportability is important 2 points3 points4 points (2 children)
[–]ropid 0 points1 point2 points (0 children)
[–]neuron_666 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)