I am trying to display size in human-readable form on HP-UX. We have a few legacy systems which we use for sftp transfers. These servers are connected T1 leased line and transfers are very slow. I have to occasionally check the size to verify if the transfer is done or not. As HP-UX cant display the size in kb or GB, we have to manually divide the output to verify. I am just trying to build a small script to display the size in GB.
read -p "Enter File Path/Location " location
output=$(ls -l $location | cut -d ' ' -f 18)
#output=$(ls -l /central/home/sftp/file.daily | cut -d ' ' -f 18)
echo "Size in GB is: ${output}"
#echo "Size in GB is: ${output} / (1024*1024*1024)" not working "
bash-4.4$ ./script
Enter File Path/Location /central/home/sftp/file.daily
Size in GB is: 153844074
bash-4.4$
Guys/Gals, I am not a pro, just learning stuff to enhance my knowledge in bash scripting.