I've a bash script that simple has to add new user and sign a password that is passed when script is called:
./adduser_script username password
/usr/sbin/useradd ... -p `openssl passwd -1 "$2"` ...
/adduser_script username aa$@bbb
have you tried strong qoutes ??
use 'aa$@bb' instead of weak qoutes i.e. "aa$@bb"
for example: check with echo command
echo "aa$@bb" will print aabb
echo 'aa$@bb' will print aa$@bb
In your script use
/usr/sbin/useradd ... -p `openssl passwd -1 '$2'` ...
now you need not to worry about qoutes while passing password as argument.