0

I have bash script and try run command inside it

That's ok

echo ${something:="zip -r -q $TAG -P $PASS $LOCPATH"}
>zip -r -q evolution -P evolution ~/.gconf/apps/evolution

That's ok too

zip -r -q evolution -P evolution ~/.gconf/apps/evolution

But here order have been changed only when passed values and added strange . -i

zip -r -q $TAG -P $PASS $LOCPATH
>zip error: Nothing to do! (try: zip -r -q -P evolution evolution . -i ~/.gconf/apps/evolution

Thanks for any advice.

2 Answers 2

3

BASH FAQ entry #50: "I'm trying to put a command in a variable, but the complex cases always fail!"

something=(zip -r -q "$TAG" -P "$PASS" "$LOCPATH")
"${something[@]}"
Sign up to request clarification or add additional context in comments.

Comments

0

Try doing type zip, seems it's aliased to something.

Maybe put the full path of zip to override this ,something like :

/usr/bin/zip

2 Comments

Sorry man. I have been edited question. Zip works ok if not passed $params.
Not aliased.type zip > zip is hashed (/usr/bin/zip)

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.