Hi All,
My requirement is to search for a Table Name [or other objects] being used in list of script placed at a dir path :
we are using below command to get the desired result :
grep -H -i <Table_name> <dir_path>/* -r|awk '{print $1}'| uniq -d
#It gives me below result
/infa/server/bin/sam/scripts/my_script.ksh:PARAM
/infa/server/bin/sam/scripts/your_script.sh:VARIABLE
Now my requirement is to get rid of those extra characters after .ksh or .sh. I could get the file_name from above command and redirect the same to temp file and using while loop can get rid of extra characters using ${STRING%.ksh} or ${STRING%.sh} . But there is anything we can append to above command to make it in one shot.
Kindly assist. Any help is appreciated.