So apparently, I can\'t source
a script if that script is in the current directory. For example,
# source some/dir/script.sh
Ok
<
Quoting the source man page:
source filename [arguments]
....
If filename does not contain a slash, file names in PATH are used to find the directory containing file- name.
So... source
is trying to search your script.sh
in the folders contained in PATH
.
If you want to source a file in the current folder use
source ./script.sh
This can happen when the file is in the wrong format. I FTP'd a Korn Shell script from Windows. I could edit it, but got "not found [No such file or directory]" when I tried to run it. It turned out it was in DOS format, which was indicated in the file name line when I edited it in vi. After I re-FTP'd it, making sure it was being transferred as ASCII, it ran fine.
Use an absolute path -- source /root/path/to/some/dir/script.sh
-- should sort you.