1

Can someone explain to me why the following shell script line throws this error:

Syntax error: "(" unexpected

2
  • 3
    yes: There is an unexpected '('. I suppose you know that ;-). What are you trying to do? Commented Feb 12, 2013 at 21:03
  • 1
    you might escape the parens: \(name=default userid=$from \ send=$TMP/basename $1\) Commented Feb 12, 2013 at 21:07

1 Answer 1

1

Shell scripts expect variables to be set in the pattern of:

VARIABLE=value

You can't have any additional = signs in there. However, you can execute other scripts like this:

VARIABLE=$(basename $1)
VARIABLE=`basename $1`

Either one works.

In your case, I can't tell what you're doing, but it isn't right at all. My guess is that you need to do this:

env LD_LIBRARY_PATH=$(basename $1)
Sign up to request clarification or add additional context in comments.

Comments

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.