Strange symbols at the end of md5sum
When you use md5sum
to calculate a MD5 hash from stdin (standard in) it outputs -
as the filename. For example,
$ md5sum hello.cff585184df1b2b93e8e67058e1e708c4 hello.c$ md5sum < hello.cff585184df1b2b93e8e67058e1e708c4 -
Note that the second command reads from stdin while the first reads directly from hello.c
If you don't want the filename, you could pipe the output to awk
- like
$ md5sum < hello.c | awk '{print $1}'ff585184df1b2b93e8e67058e1e708c4
Or, for your specific case,
UUID="$(echo -n "$timestamp" | md5sum | awk '{print $1}')"
Or,
UUID="$(printf $timestamp | md5sum | awk '{print $1}')"