1

I want to load some variable from a text file into my batch script. I tried searching but I only find tips for files like

VALUE1
VALUE2
...

My TEXT-File has the following format:

VER=123
MIN_VER=123456789
TARGET_VER=132456790

And I want to be able to load this file so that I can access the three variables for matching it against a number in bash. How can I achieve this?


Answered! Thanks!

0

1 Answer 1

3

Save your variables to file like you want (VAR=VAL) and run:

. ./your_file

Maybe there will have to be"#!/bin/bash" at the beginning of this file. False

Sign up to request clarification or add additional context in comments.

1 Comment

I have no control over the variables file (I try to match a plugin updater script against the version of the firmware image) - But as I call thet from /bin/bash it should work - if you're right - Waah I am stupid^^ It worked - Thx!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.