Bash Shell Expansions: Brace Expansion, Parameter Expansion and more
In this article we will cover all the basic features of Bash Shell expansion including Brace Expansion, Parameter Expansion, Word Splitting, Filename, Arithmetic Expansion and Variable substitution and more. We will cover numerous topics and show examples of the command and most useful syntaxes for each syntax.
Using Bash Parameter Expansion for Conditionals in GitHub Actions
I am late to using GitHub Actions for CI, and immediately ran into an issue trying to figure out how to conditionally install a different version of Bundler for a certain version of Rails in radar/distance_of_time_in_words#104. Bundler 2.x doesn’t work with Rails 4, and needs to be downgraded.
How to split one string into multiple variables in bash shell?
I've been looking for a solution and found similar questions, only they were attempting to split sentences with spaces between them, and the answers do not work for my situation.
Currently a varia...
Bash: Renaming files using shell parameter expansion
Shell parameter expansion provides various ways to manipulate strings, and a convenient way to succinctly express renaming a set of files. In its simplest form, parameter expansion is simply ${parameter}. But look at these examples: $ mystr="TheQuickBrownFox.jpg" # chop off last 4 digits $ echo ${mystr:0:-4} TheQuickBrownFox # truncate end of string '.jpg' $ echo ... Bash: Renaming files using shell parameter expansion
Bash Parameter Expansion: Variable Unset or Null ${YOU_BE_THE:-“Judge”}
I came across a lesser-used Bash idiom while attempting to implement ZeroSSL TLS certificates. Specifically, in ZeroSSL’s wrapper script to install their implementation of certbot. The idiom …