AWK : To print the first item along with the row number(NR) separated with ” – “ from each line

 [prabhucloudxlab@cxln4 ~]$ cat>hello.sh
#! bin/bash
#To print the first item along with the row number(NR) separated with ” – “ from each line

echo "enter a filename to print from awk"
read fileName
if [[ -f $fileName ]]
then
         awk ' {print NR "- " $1 } ' $fileName
        echo "==============================================================="
else
    echo "$fileName doesn't exist"
fi


[prabhucloudxlab@cxln4 ~]$ sh hello.sh
enter a filename to print from awk
filegrep.txt
1- This
2- This
3- This
4- This
5- This
6- This
7- This
8- This
9- This
10- This
11- This
12- This
===============================================================