for f in *;
do 
	exten="$(file --mime-type -b $f | cut -d '/' -f2)";
	case $exten in
		["x-c"]*)
			mv "$f" "$f.c" 
			;;
		["plain"]*)  #to avoid scrip file present
			;;
		*)
			mv "$f" "$f.$exten"
			;;
	esac
done