I need a ksh script that will find the newest file in a directory:
root@phxsa2 in /usr2/HHM/pub/SMM/transfer/request
# ls -t | head -n1|cat
izdata_656701_20140702_64897.rejected.dat
root@phxsa2 in /usr2/HHM/pub/SMM/transfer/request
Then email that file to a specified user:
mail -s " BYIM rejection file for 'DATE'" user@local.org < "filename"
I am unsure of how to either assign the file to a value or send the contents of the file in the email...???
Any help would be gratefully appreciated...
root@phxsa2 in /usr2/HHM/pub/SMM/transfer/request
# ls -t | head -n1|cat
izdata_656701_20140702_64897.rejected.dat
root@phxsa2 in /usr2/HHM/pub/SMM/transfer/request
Then email that file to a specified user:
mail -s " BYIM rejection file for 'DATE'" user@local.org < "filename"
I am unsure of how to either assign the file to a value or send the contents of the file in the email...???
Any help would be gratefully appreciated...