Alias substitution for a string to use it in a terminal command
You can't do it like this because /home/user/
is not a command. It't more like a static string.
From man bash
(somewhere at line 1984):
Aliases allow a string to be substituted for a word when it is used as the first word of a simple command.
In your case, execloc
will never be the first word of a simple command.
But, instead to define execloc
as an alias, you can define it as an environment variable:
export execloc='/home/user/'
And then you can use it everywhere you want as follow:
cd $exeloc/temp/somefolder