Reputation: 1275
If I run this script:
#!/bin/bash
PROJECT_PATH="/Users/hudson/workspace/Foo"
XCODE_PROJECT_FOLDER="${PROJECT_PATH}/CODE/APP/FOO_IOS"
echo ${PROJECT_PATH}
echo ${XCODE_PROJECT_FOLDER}
It displays:
/Users/hudson/workspace/Foo
/Users/hudson/workspace/Foo/CODE/APP/FOO_IOS
If I put the variables in another file, include it in the main script file, and run it:
test.sh
#!/bin/bash
. "/Users/hudson/workspace/Foo/ota.sh"
echo ${PROJECT_PATH}
echo ${XCODE_PROJECT_FOLDER}
/Users/hudson/workspace/Foo/ota.sh
#!/bin/bash
PROJECT_PATH="/Users/hudson/workspace/Foo"
XCODE_PROJECT_FOLDER="${PROJECT_PATH}/CODE/APP/FOO_IOS"
I have this output:
: command not found /Users/hudson/workspace/Foo/ota.sh: line 2:
/Users/hudson/workspace/Foo
/CODE/APP/FOO_IOSkspace/Foo
Any idea of where the problem could come from?
Upvotes: 1
Views: 324
Reputation: 765
As with the previous answer, probably wrong/mixed unix/windows line endings. If you are using notepad++,as Mike mentioned, in notepadd++, you can change the EOL character(s) by choosing the Edit menu, then EOL Conversion. After reading Mike's comment, that is what fixed this same exact problem that the op mentioned, that I was having too.
Upvotes: 0
Reputation: 58788
Try opening the file in vim
, to see if there are any special characters there, like backspace.
Upvotes: 0
Reputation: 96258
Probably wrong/mixed unix/windows line endings, try to fix it with dos2unix
.
Upvotes: 2