04-04-2005
1,
0
Join Date: Apr 2005
Last Activity: 5 April 2005, 8:18 PM EDT
Posts: 1
Thanks Given: 0
Thanked 0 Times in 0 Posts
Script help!
I'm trying to create a script that uses egrep. I am having problems with the beginning of the script, where it takes the "name" of what I want to search using egrep.
All I know is to do it in this manner:
echo "Enter A Filename:"
read filename
Is it possible to do it so I won't need the prompt where it asks the user to enter the filename?
So I can just execute the script from the shell along with the filename, and it will automatically take the filename and use that with egrep.
Like This:
"myscript.sh file001"
Instead Of This:
"myscript.sh"
Enter A Filename: "file001"
The beginning of my script currently looks like this:
echo "Enter A Filename:"
read filename
egrep "$filename" etc... etc........