The following python script:
def run_build(path):
cmd = path + '/build.sh'
p = subprocess.call(cmd)
The following bash script exec two another scripts:
#!/bin/bash
cd "${0%/*}"
echo $(./create_env.sh)
echo $(./set_webhook.sh)
echo $(docker-compose up -d --build)
create_env.sh:
#!/bin/bash
PORT=$(comm -23 <(seq 7000 8000 | sort) <(ss -tan | awk '{print $4}' | cut -d':' -f2 | grep "[0-9]\{1,5\}" | sort -u) | head -n 1)
MONGODB_PORT=$(comm -23 <(seq 27017 27100 | sort) <(ss -tan | awk '{print $4}' | cut -d':' -f2 | grep "[0-9]\{1,5\}" | sort -u) | head -n 1)
destdir=$PWD/.env
echo >> "$destdir"
echo "APP_PORT=$PORT" >> "$destdir"
echo "MONGODB_PORT=$MONGODB_PORT" >> "$destdir"
The output is:
Path: /home/navka/Environments/teststartupservicebot/build.sh
./create_env.sh: line 2: head: command not found
./create_env.sh: line 2: comm: command not found
./create_env.sh: line 2: seq: command not found
...
Where is my problem? Thanks!