1

I am trying to run a bash script from a script called dev_ro, here is how it's being called.

export SUBNET="$(first_available_docker_network --lock-seconds 7200)"

I am calling dev_ro by ./dev_ro

I am confirm I have

#!/bin/bash

at the top of both files.

Here are perms for both files

 $ ls -lh dev_ro 
-rwxrwxr-x 1 ME ME 423 Aug 21 15:57 dev_ro

$ ls -lh first_available_docker_network
-rwxrwxr-x 1 ME ME 2.2K Aug 21 15:55 first_available_docker_network

This is the output from running ./dev_ro

++ first_available_docker_network --lock-seconds 7200
compose/everest-compose: line 25: first_available_docker_network: command not found

Additionally when I try to run the script:

ME@SERVER:~/Rosetta/compose$ first_available_docker_network
first_available_docker_network: command not found
ME@SERVER:~/Rosetta/compose$ 

I have the same setup running on a different server and it's working. The code was pulled from Git, so it's the same codebase.

Any help is much appreciated.

ME@OTHER_SERVER:~/Rosetta/compose$ first_available_docker_network
DEBUG:root:Docker subnets: [IPv4Network(... etc
ME@OTHER_SERVER:~/Rosetta/compose$ ^C
jww
  • 97,681
  • 90
  • 411
  • 885
Andy
  • 373
  • 1
  • 7
  • 24
  • 1
    Add full path to `first_available_docker_network` or use `./first_available_docker_network` if it is in current directory or check your `PATH` variable. – Cyrus Aug 21 '19 at 06:46
  • Found out what it was - I had some env vars injected by salt. – Andy Oct 02 '19 at 08:28

1 Answers1

1

first_available_docker_network is not a standard linux command. This must be your custom script. Try executing using its absolute path. For example, instead of using+

ME@SERVER:~/Rosetta/compose$ first_available_docker_network

use

ME@SERVER:~/Rosetta/compose$ absolute_path_of_script/first_available_docker_network

Or alternatively,

You can try adding the path of first_available_docker_network to the PATH variable.

7_R3X
  • 3,904
  • 4
  • 25
  • 43