I have a package.json
{
version: "1.0.0",
}
And below is my content
version=$(jq -r '.version' package.json)
echo version
of my bash.sh file, but I couldn't get the '1.0.0', I got version
printed on my terminal, any clue why?
Assuming this is bash, you are missing a dollar sign on this line:
echo $version
so you are printing a string instead of referring to a variable.