If I have a bash script like:
PATH_SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
echo "$PATH_SCRIPT"
If will echo something like:
/c/path/to/where/the/file/is
And generally, that is okay. But in some places, if running on windows, I'll actually need to parse this variable so it looks like this:
C:\path\to\where\the\file\is
How can I do that properly in bash and be able to pass it around?