#!/bin/bash
#In this case instead of using PIPESTATUS Array for checking previous command exit code,I try this method:
PC=$(wget --spider "$1" 2>&1)
if [ $? -ne 0 ];then
echo -e "\033[1m The Interested File Doesn't Exist.\033[0m"
exit 1
else
awk '/^Length/ {gsub(/\(|\)/,"",$3);printf("\033[1mSize: %s\033[0m\n",$3)}' <<< "$PC"
exit 0
fi