Re: clever grep..

2024-10-17 Thread Dan
Thank you both, Mike and Steve, also due to the late time I thought to the most complicated stuff. -Dan Steve Williams : > Mike Fischer wrote: > >> grep "return 301 $host$request_uri" *.conf > > Hi, > > I think you missed the point. > > grep "return 301 $host$request_uri" *.conf > > $host eval

Re: clever grep..

2024-10-17 Thread Steve Williams
On 13/10/2024 9:44 p.m., Mike Fischer wrote: grep "return 301 $host$request_uri" *.conf Hi, I think you missed the point. grep "return 301 $host$request_uri" *.conf $host evaluates to the empty string $request_uri evaluates to the empty string resulting in: grep "return 301 " *.conf You wa

Re: clever grep..

2024-10-14 Thread Dan
Thanks, received. Indeed adding just a single a space after the "return 301" get to the same result. -Dan Mike Fischer wrote: > > > Am 14.10.2024 um 04:35 schrieb Dan : > > > > grep "return 301 $host$request_uri" *.conf > > The shell will interpret any $… sequences in double quotes as > v

Re: clever grep..

2024-10-13 Thread Mike Fischer
> Am 14.10.2024 um 04:35 schrieb Dan : > > grep "return 301 $host$request_uri" *.conf The shell will interpret any $… sequences in double quotes as variables. Use single quotes or try to escape the $ characters. HTH Mike