How to change into script dir in bash

2016-12-21 | #bash, #solution

This is not complicated ... only difficult to remember. So here it is, to switch into the script's own directory without naming it explicitly, do the following magic:

#!/usr/bin/env bash

cd "${0%/*}" && \

other_command -i "need to run"