Answer the question
In order to leave comments, you need to log in
Why doesn't curl from bash script work?
There is this script:
#!/usr/bin/env bach
curl -o /home/user/local.txt http://localhost/download/server.txt
$ bash /home/user/my-script.sh
curl: command not found
$ curl -o /home/user/local.txt http://localhost/download/server.txt
Answer the question
In order to leave comments, you need to log in
different paths in PATH
echo $PATH just
run
without bash
./my-script.sh
#!/usr/bin/env bach
man bach
No manual entry for bach
#!/bin/bash
#!/usr/bin/env bash
In general, it is better to set full paths to commands in scripts.
for example
#!/usr/bin/env bach
/usr/bin/curl -o /home/user/local.txt http://localhost/download/server.txt
#!/bin/sh
PATH=/path/to/bin
export PATH
....
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question