0

I have file containing 1100 variables. Example,

LOGPATH=/some/path
VARIABLE2=someVALUE

while running source /path/to/file.properties

Only the first set number of variables are being loaded. Is there a environment property that defines how many variables can be loaded.

getconf ARG_MAX gives 2097152

++ SERVICE_DATA=/some/path/data
++ AUTO_FETCH_LIMIT=25000

echo $AUTO_FETCH_LIMIT

echo $SERVICE_DATA
    /some/path/data
echo $AUTO_FETCH_LIMIT | wc
      1       0       1
12
  • 2
    Use set -x and examine the output Commented Oct 2, 2023 at 13:33
  • set -x shows the line is executed. ++ LOGDIR=/some/path but echo $LOGDIR still shows no results. Any variables after a specific line is not loaded. If i toggle the positions, the previously missing values are loaded, but the bottom ones are not. Commented Oct 2, 2023 at 13:48
  • 3
    (a) Check for unbalanced quotes in the sourced file. (b) Take out the first 50 lines (in a copy of the file), and see if it fails at the same line, or the same line number. (c) Use declare -p varName for debug, not echo. Commented Oct 2, 2023 at 14:31
  • 1
    there should be an off-line version of shellcheck.net that you could run on the command line to sanity-check the sourced script (it might notice e.g. those unbalanced quotes) Commented Oct 2, 2023 at 15:28
  • 1
    There is no "variable load limit". The source comand isn't for loading variables; it's for script execution. The contents of the file are executed; if it contains nothing but assignments, then it loads variables. Commented Oct 2, 2023 at 19:08

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.