Note: The following is a problem for source, cd, ls etc. when the command is inside an execute bash file versus type directory into termnial:
Note: The file was originally created in Windows, but edited using Xcode on Mac:
so I have file test.sh
Contains
#!/bin/bash
cd "/usr/bin/"
I call like this in terminal:
source test.sh
Gives error
test.sh:cd:2: no such file or directory: /usr/bin/^M
I have tried just about everything I can think of…