Dear learner,
Hope you are doing great.
Please have a look on the below soltion for your reference.
While specifying path, please mention full path of the HIVE_HOME instead of specifying $HIVE_HOME
Please refer below command
SOURCE /usr/lib/hive-0.13.1-bin/scripts/metastore/upgrade
Please try and let us know if you have any other issue so we can help you out.