Problem using grep through the unix shell: doesn't accept a regular expression in filename
From: Francois (merguez99_at_yahoo.fr)
Date: 11/09/04
- Next message: Stephane CHAZELAS: "Re: Is there a remedy to this mistake?"
- Previous message: RK: "Is there a remedy to this mistake?"
- Next in thread: Stephane CHAZELAS: "Re: Problem using grep through the unix shell: doesn't accept a regular expression in filename"
- Reply: Stephane CHAZELAS: "Re: Problem using grep through the unix shell: doesn't accept a regular expression in filename"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 9 Nov 2004 11:59:42 -0800
Hi,
I'm using the following simple grep command through a .sh shell
script:
#######
#\bin\bash
grep "mypattern" < $1
#######
However it works perfectly when i execute it on the command prompt by
replacing $1 by *.txt for example, but when I call the script using
myscript.sh *.txt
The *.txt only takes into account the first file matching the regular
expression and not the others! It seems quite weird, does anyone had a
similar problem?
Thanks a lot
- Next message: Stephane CHAZELAS: "Re: Is there a remedy to this mistake?"
- Previous message: RK: "Is there a remedy to this mistake?"
- Next in thread: Stephane CHAZELAS: "Re: Problem using grep through the unix shell: doesn't accept a regular expression in filename"
- Reply: Stephane CHAZELAS: "Re: Problem using grep through the unix shell: doesn't accept a regular expression in filename"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|