I'm running an online store where I can put a variable versiontag to includes JS and CSS as a cachebuster. I. e.
styles.css?v2018_01
Wherein the 2018_01
is the version tag. Now I also have a CLI tool that makes it quick to set like so
mr config:set 'design/head/meta_version_tag' [insert_my_var_here]
And what I want to do is create a Bash alias that sets the variable to the Unix timestamp whenever it is run. I know I can get the Unix timestamp with date +%s
.
So I would make an alias like this:
mr config:set 'design/head/meta_version_tag' date +%s
But the CLI interprets the date +%s
as a string, rather than getting its output first.
So what I need is an output like this:
mr config:set 'design/head/meta_version_tag' 1519747390
And so my question is; how can I get the output of the unix datestamp in my alias?