Ok. Try this:
#!/bin/sh
# set -x
echo "Enter a string to search for:"; read ans
test -n "${ans}" && find . -type f | xargs -ix grep 'x' -e $ans
*If you uncomment the "set -x" you'll get debug mode to show you how it works.
Here's some scripting references:
Introduction to BASH shell scripting:
http://www.linuxorbit.com/modules.ph...icle&artid=459
A Quick Introduction to Bash Programming:
http://www.geocities.com/tipsforlinu...cles2/043.html
A's to Q's about BASH, the Bourne-Again SHell:
http://apodeline.free.fr/FAQ/bashFAQ/bash.html
BASH Programming - Introduction HOW-TO:
http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
Advanced Bash Scripting Guide (ABS):
http://www.tldp.org/LDP/abs/html/
Shell script resources:
Heiner's SHELLdorado:
http://www.shelldorado.com
Linuxguru's shell scrip resources:
http://www.linuxguruz.org/z.php?id=911
Working more productively with bash 2.x (Caliban.org, completion, good stuff):
http://www.caliban.org/bash/
*Also search LQ for scripts and tips.