Hello,
I wondering how I can echo a string without having the trailing whitespace removed.
For example I have a string str="TESTING123 " that I need to hash using sha1. I get the correct answer when I run the line below from the terminal
$ echo -n "TESTING123 " | openssl sha1
fe1a126175cf589be634fc3a41a7701a78f5ad28
However when I pass the string as a variable I get a different answer as the trailing whitespace is removed.
str="TESTING123 "
echo -n $str | openssl sha1
18aa7ac11356238ef89cfbd2875727dcd054d6ed
Is there a particular way I should declare this variable or something?
Regards,
Colin