I want to do things like this:
local_config="~/.local_config"
source $local_config
But it seems that the string is not treated as a file path.
I'm using Zsh.
I want to do things like this:
local_config="~/.local_config"
source $local_config
But it seems that the string is not treated as a file path.
I'm using Zsh.
Try without quotes:
local_config=~/.local_config
or
local_config="$HOME/.local_config"
~
is not expanded inside the single or double quotes. To make it work, keep ~
outside the quotes as:
local_config=~"/.local_config"