Putting a multi-line file into a Redis value with a quoted argument on the command line is a quoting headache. redis-cli has a flag that skips all of it.
redis-cli -x SET notes < notes.txt
With -x, redis-cli reads the last argument of the command from stdin. The Redis docs use it to store /etc/services in a key and read part of it back with GETRANGE, and call it useful for scripting.
The value is stored exactly as it arrives. In a throwaway instance on redis-cli 7.0.15, a file containing a b and c on two lines came back as "a b\nc\n", spaces and newlines included.
That is also the caveat. A command like echo hi | redis-cli -x SET greeting stores hi plus the newline that echo adds: STRLEN greeting returned 3 there. Use printf %s hi or echo -n if you don’t want the newline.
The help text also lists a sibling, -X, which takes a tag name and puts the stdin data where that tag appears in the command. The example given there copies a key to another name:
redis-cli -D "" --raw dump key > key.dump
redis-cli -X dump_tag restore key2 0 dump_tag replace < key.dump
-D "" sets an empty delimiter between replies, as the usage text describes for raw formatting. That sequence is straight from the usage examples. A run in a scratch instance with a small string key restored it as key2 without problems.
Further reading: Redis CLI: get input from other programs