How do I parse command line arguments in Bash?

Bash Space-Separated (e.g., –option argument) Output from copy-pasting the block above Usage Bash Equals-Separated (e.g., –option=argument) Output from copy-pasting the block above Usage To better understand ${i#*=} search for “Substring Removal” in this guide. It is functionally equivalent to `sed ‘s/[^=]*=//’ <<< “$i”` which calls a needless subprocess or `echo “$i” | sed ‘s/[^=]*=//’` which calls two needless subprocesses. Using bash with getopt[s] getopt(1) limitations (older, … Read more

How to find which version of TensorFlow is installed in my system?

This depends on how you installed TensorFlow. I am going to use the same headings used by TensorFlow’s installation instructions to structure this answer. Pip installation Run: Note that python is symlinked to /usr/bin/python3 in some Linux distributions, so use python instead of python3 in these cases. pip list | grep tensorflow for Python 2 … Read more

Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)

The problem is that Xcode Command-line Tools needs to be updated. Solution #1 Go back to your terminal and enter: You’ll then receive the following output: You will then be prompted in a window to update Xcode Command Line tools. (which may take a while) Open a new terminal window and your development tools should … Read more

Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)

The problem is that Xcode Command-line Tools needs to be updated. Solution #1 Go back to your terminal and enter: You’ll then receive the following output: You will then be prompted in a window to update Xcode Command Line tools. (which may take a while) Open a new terminal window and your development tools should … Read more

How to pretty print XML from the command line?

This utility comes with libxml2-utils: Perl’s XML::Twig This command comes with XML::Twig perl module, sometimes xml-twig-tools package: xmlstarlet This command comes with xmlstarlet: tidy Check the tidy package: Python Python’s xml.dom.minidom can format XML (works also on legacy python2): saxon-lint You need saxon-lint: saxon-HE You need saxon-HE: