Question

I am using Jasypt 1.9, and when I try to encrypt a password with exclamation it fails. It works fine without exclamation

for ex:

./encrypt.sh input="abc!abc"
-sh: !abc": event not found

Jasypt claims it is fixed here.. http://www.jasypt.org/changelogs/jasypt/ChangeLog.txt

Note:

 ./encrypt.sh input="abc\!abc" works, but decrypting produces the "abc\!abc"
Was it helpful?

Solution

Use single quotes instead of double. With double quotes, the shell first tries to expand !abc as a history event, giving you that error. Text in single quotes is not expanded.

This is a linux shell feature, and has nothing to do with Jasypt. The shell is expanding the expression before it executes anything.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top