0

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?

1
  • 2
    If this is a bash or dash or sh script, you do not need to (and probably shouldn't) terminate lines with semicolons. Commented Mar 4, 2011 at 17:48

1 Answer 1

7

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

Sign up to request clarification or add additional context in comments.

4 Comments

+1 and also, you should be using a build tool like make for this kind of thing. Not a shell script.
@Noufal Ibrahim, to generate headers from java sources and compile ndk project... make?
I'm not at all familiar with java and have no experience with the ecosystem but I'm guessing that you're doing some kind of build and so recommend a build system like make (which is what I'm used to).
"if you want to change the oil in your car, you should first learn how to build a car repair shop."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.