a redirect question

a redirect question

Post by Farid Hamjavar UNM-CI » Thu, 14 Aug 2003 04:42:07



greetings,

I use (inside a bash script) the apache logresove this
way for post-processing:

   ${logres} -s ${statfile} -c < ${logfile} > ${output}

logresolve spits out messages like this :
Bad host: invisible2.bancomext.gob.mx != 200.33.70.2
Bad host: ns6.pilosoft.com != 66.250.56.254

It's OK. I just wanted to re-direct them into a file.

Do you know how, given the above syntax and that this is
in bash/sh environment?

Thanks,
Farid

 
 
 

a redirect question

Post by Moshe Jacobso » Thu, 14 Aug 2003 05:36:37


Farid Hamjavar UNM-CIRT had nothing better to do than to say:

Quote:>    ${logres} -s ${statfile} -c < ${logfile} > ${output}
> logresolve spits out messages like this :
> Bad host: invisible2.bancomext.gob.mx != 200.33.70.2
> Bad host: ns6.pilosoft.com != 66.250.56.254
> It's OK. I just wanted to re-direct them into a file.

Assuming you want to put the error output into a file called
logresolve.err, you can append   2>logresolve.err  to the end of the
commandline.  This will point file descriptor #2 (standard error) at
the output file.

Moshe

--
*** SPAM BLOCK: Remove bra before replying! ***
Moshe Jacobson :: http://runslinux.net :: moshe at runslinux dot net
!! FBI Arreseting Programmers?  http://www.freesklyarov.org
!! Trust Microsoft Anti-Trust:  http://www.anti-dmca.org

 
 
 

a redirect question

Post by Chris Matter » Thu, 14 Aug 2003 06:25:24



> greetings,

> I use (inside a bash script) the apache logresove this
> way for post-processing:

>    ${logres} -s ${statfile} -c < ${logfile} > ${output}

> logresolve spits out messages like this :
> Bad host: invisible2.bancomext.gob.mx != 200.33.70.2
> Bad host: ns6.pilosoft.com != 66.250.56.254

> It's OK. I just wanted to re-direct them into a file.

> Do you know how, given the above syntax and that this is
> in bash/sh environment?

Your problem is that these messages are being written to
standard error (stderr).  Since you have the good sense
not to csh/tcsh, this is easily dealt with:

  ${logres} -s ${statfile} -c < ${logfile} > ${output} 2> ${error_output}

or, if you want it lumped together with stdout in one
file:

  ${logres} -s ${statfile} -c < ${logfile} > ${output} 2>&1

                    Chris Mattern

 
 
 

a redirect question

Post by scriptOmati » Thu, 14 Aug 2003 06:32:41



> greetings,

> I use (inside a bash script) the apache logresove this
> way for post-processing:

>    ${logres} -s ${statfile} -c < ${logfile} > ${output}

> logresolve spits out messages like this :
> Bad host: invisible2.bancomext.gob.mx != 200.33.70.2
> Bad host: ns6.pilosoft.com != 66.250.56.254

> It's OK. I just wanted to re-direct them into a file.

> Do you know how, given the above syntax and that this is
> in bash/sh environment?

> Thanks,
> Farid

you already have a redirect of stdout, so it is stderr you need to
redirect.

${logres} -s ${statfile} -c < ${logfile} > ${output} 2>&1 # both stdout
and stderr in one file
OR
${logres} -s ${statfile} -c < ${logfile} > ${output} 2>${errfile} #
naturally, errfile must be defined

--
http://ftp.opensysmon.com is a shell script archive site with an
open source system monitoring and network monitoring software package.
Many platforms are supplied already compiled.

 
 
 

1. Apache Redirect/ReWrite for redirecting old->new domains?

Hello:

I'm having some difficulty getting Apache to redirect page requests with
an informative message.  My place of employment is moving from their old
domain name to a new one.  We now have both of these domain names active,
both of which point to the same server.  Although we will be phasing out
the old address very soon, people continue accessing the pages at the old
address, hence the reason for the redirect.

Putting something like <META HTTP-EQUIV="refresh"
"CONTENT=05;URL=http://newdomain.com/newpage"> in all our pages is not
an optimal solution because (a) there are hundreds of pages that would
need to be updated, (b) this solution doesn't display an informative
message before the redirect, and (c) Apache provides a better solution.

I've tried using a RedirectMatch:

RedirectMatch http://olddomain.com/~test/(.*) http://newdomain.com/~test/$1

Unfortunately, any pages access in .../~test do not redirect, but access
from the olddomain.com.

I've also tried a RewriteRule:

RewriteRule http://olddomain.com/~test/.* http://newdomain.com/~test/$1 [R=301L]

This also doesn't seem to work.

Is there a way to redirect visitors to all pages (or some pages in a
given directory or directories) with an informative message that appears
for about 5 seconds from the old access point to the new one?  (Notice I
say "access point" instead of "old page to new page" -- since the pages
are the _same_ as the old and new addresses point to the same server)

Thanks in advance for any assistance.

--------------< LINUX: The choice of a GNU generation. >--------------

2. Printing to JetDirect EX Plus3

3. redirect sound card redirected to /dev/null

4. polling sockets

5. .redirect not redirecting to some places

6. Week of 1/16 - 1/22 Digicom DI3635 modem setup

7. : Weird ">" redirect behavior vs. ">>" redirect behavior

8. SB Live! driver on SMP machine?

9. Port Redirect works but doesn't redirect internal traffic

10. Apache newbie- question on redirect

11. Fork/redirect/pipe question (checked faq)

12. Question: Redirecting mail file

13. redirecting output question