Y
Y
youngmysteriouslight2018-02-05 23:45:17
bash
youngmysteriouslight, 2018-02-05 23:45:17

How can an existing script not be found?

# user config
if [ -e config ]
then
  chmod a+x config # на всякий случай
  . config
fi

This script must import the variables defined in the config.
Writes: ./server: 12: .: config: not found
What could be the reason?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2018-02-05
@youngmysteriouslight

you apparently do not have the current folder in PATH.
And you need to execute
which means
source ./config
which means
to call the config file from the current ./ folder
ps By default, Linux does not look for a file to execute in the current directory. Searches strictly according to the list of directories specified in the PATH variable

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question