Do you mean search and return or search and replace?
Search and return
Create the following file
#!/usr/bin/ksh
echo "Enter Dir containing File"
read dir
echo "Enter filename to search"
read file
echo "Word or phrase to search for"
read word
cat $dir/$file|grep $word
To search and replace
Create the following file
call this one ask.sh
#!/usr/bin/ksh
echo "Enter Dir containing File"
read dir
echo "Enter filename to search"
read file
echo "Word or phrase to replace"
read word
echo "Replace with"
read replace
sed "s/$word/$replace/g" $dir/$file > new.txt
remember to chmod 700 them all to give yourself read write execute permissions.
Mike
--
| Mike Nixon
| Unix Admin
|
----------------------------