sh: double-quote $key, remove unnecessary $ from RANDOM