#!/bin/bash
# 
# 

if [ $# -lt 1 ]
then echo "Missing parameters"; exit
else echo "Param number: "$# 
fi

echo "“Executing "$0 $@ 

largestSize=0
largestFile=

for i
do
    if [ -f $i ] 
    then 
         size=$(ls -l $i | cut -d" " -f 5) 
         echo $i "is a regular file with size" $size
         if [ $size -gt $largestSize ]
         then largestSize=$size
              largestFile=$i
         fi
    else
        if [ -d $i ]
        then echo $i "is a directory"
        fi
    fi
done

if [ $largestSize -gt 0 ]
then echo "Largest file is" $largestFile" with size" $largestSize
else
    echo "No regular files"
fi 
