Why 0 is true but false is 1 in the shell?

It’s a convention, but a particularly useful one when you think about it. In general, if a program succeeds that’s all you need to know. If it fails, however, you might need to know all kinds of information about the failure – why it happened, how to fix it, etc. Having zero mean ‘success’ and … Read more

How to do multiline shell script in Ansible

Ansible uses YAML syntax in its playbooks. YAML has a number of block operators: The > is a folding block operator. That is, it joins multiple lines together by spaces. The following syntax: key: > This text has multiple lines Would assign the value This text has multiple lines\n to key. The | character is … Read more

How to set environment variables from .env file

If your lines are valid, trusted shell but for the export command This requires appropriate shell quoting. It’s thus appropriate if you would have a line like foo=’bar baz’, but not if that same line would be written foo=bar baz set -a # automatically export all variables source .env set +a If your lines are … Read more