Here's a rough ideal on what you need to do.. Assuming you are just looking for one file at a time.
ls ${DIR} | grep "$VARIABLE"
if [ $? -eq 0 ]
then
<do mail command here, unsure how to do attachment as this moment>
fi
Quote:
Originally Posted by jagadeeshtata
Hi All,
I need to search a text in a string, assign it to a variable.
Ex :
I need to get the number that has gif extension. The number is not constant. The search value should return as 1174499845 from the following string.
x 1174499845.gif, 133982 bytes, 262 tape blocks
Go to relevant directory, search for the the variable (example 1174499845) in the directory.
if exists Mail it as attachment else display "required attachment" not available.
Thanks in advance.
Jagadeesh Tata.
|