开发者

Shell script takes variable as a command

I'm coding an extremely simple开发者_如何转开发 shell script and it doesn't really work as it should. Here are the contents:

# Defining base project directory
BASE_DIR=/path/to/proj;
PRODUCTION_DIR = $BASE_DIR/out/production/dir;

# Generating headers
javah -classpath $PRODUCTION_DIR -d $BASE_DIR/jni/include com.my.class.Name

#     Building native libs
ndk-build

Paths are correct, it works if I remove $PRODUCTION_DIR, if I'll run it like this, it says:

line 3: PRODUCTION_DIR: command not found
...

Does any one know what's wrong?


Remove whitespace,

PRODUCTION_DIR=$BASE_DIR/out/production/dir

Otherwise you're trying to run PRODUCTION_DIR with parameters = and $BASE_DIR/out/production/dir

Also, remove the ;'s at end of line, they're redundant

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜