|
|
|
|
|
by torbjorn
3125 days ago
|
|
What the author says about aliases in the bashrc being evaluated only once when the bashrc is run when the shell session is opened is wrong. Go ahead and try this: Put, alias lb='vim ~/logbook/$(date "+%s")'
in your bashrc.Source the bashrc. Run the lb command. It creates a new file with a different epoch timestamp each time. This `lb` command doesn't need to be a bash function. It can be an alias and work just fine. Maybe how this works in zsh is different... |
|
It doesn't make sense. If you do
it's not like Vim opens when your shell starts.The only way to have a "precomputed" alias is to get the quoting wrong, and leave $() in double quotes instead of single quotes, meaning it will be evaluated before the alias is even assigned.