Env variables in script

Hi All,

I have script and it's hardcoded the script ca invoke in user home dir and logs will be redirected to home dir of user.

how to make the same script will be invoke from /usr/bin with out chg the logs and other functions path from /user/homedir .

code is below: pls check how to access the script from common place/usr/bin without chg the code and paths?

#!/bin/bash
#diff.sh  [run ./diff.sh to invoke the script in /user/HOME ]
pwd=/user/$user
mkdir -p $HOME/OUTPUT/logs
cd /view/$VIEW_NAME/vobs/MHC_BUILD/MHC_BuildTree
echo -e "\n COMPONENT BASELINES IN VIEW \n"
echo -e " BASELINES IN VIEW \n" 2>&1 >> /$HOME/OUTPUT/logs//log_$(date +%d%m%y);
label=`$cleartool lsstream -fmt "%[found_bls]NXp\n" -view $VIEW_NAME 
$cleartool lsstream -fmt "%[latest_bls]XCp\n" -view $VIEW_NAME | sed 's/,/\n/g' | sort 2>&1 >> /$HOME/OUTPUT/logs//log_$(date +%d%m%y);
cp -f -r $HOME/OUTPUT/logs $PWD/OUTPUT

Once you corrected the hardcoded errors the script can be run from any place.