Pianoc
Pianoc

Reputation: 797

Shell to .bat script

I'm converting a shell script that works into a .bat file.

Does anyone know how I would approach getting a version number from a file:

VERSION="$(<dist/public/VERSION)"
echo "Version: ${VERSION}"

This does not work:

set VERSION=dist\public\VERSION
echo "Version: %{VERSION}"

Upvotes: 1

Views: 110

Answers (1)

Dmitry Grigoryev
Dmitry Grigoryev

Reputation: 3204

The correct syntax would be:

set /p VERSION=<dist\public\VERSION
echo Version: %VERSION%

Upvotes: 1

Related Questions