For some simple if-else conditions you may want to avoid having whole if; then; else; fi type of code. Instead, you can do it all in one bash if shorthand line. Here is how.
Continue readingMonth: October 2023
print all combinations from given range recursively
Sometimes you may encounter situations, when you wish to display all possible combinations of characters from given charset (e.g. some brute-force task). For example, print “a … zzz”, i.e. range is “a … z” and maximum length is 3. You can easily do this in bash (print recursively).
Continue reading“Hello World” in bash
Let’s suppose that you have just opened Linux terminal for the first time in your life. Your wish is to write nothing but bash “hello world” type of thing. As this command is one-liner, you can simply do this:
Continue reading