Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

346
Views
No se puede registrar la salida de "apachectl configtest" en un archivo

Quiero registrar la salida del comando "apachectl configtest" en un archivo. Así que probé los siguientes comandos:

 root@ubuntu:~# echo $(apachectl -t) >> /tmp/apache_config_check [Sun Feb 21 14:35:23.614947 2016] [proxy_html:notice] [pid 29249] AH01425: I18n support in mod_proxy_html requires mod_xml2enc. Without it, non-ASCII characters in proxied pages are likely to display incorrectly. Syntax OK

Pero dio salida vacía:

 root@ubuntu:~# cat /tmp/apache_config_check root@ubuntu:~#

También probé una variación del comando en sí:

 root@ubuntu:~# apachectl -t >> /tmp/apache_config_check

y una variación de la camiseta:

 root@ubuntu:~# $(apachectl -t) | tee /tmp/apache_config_check

Sin suerte

Realmente no conozco ningún otro método para canalizar la salida, ni sé por qué fallaron los comandos anteriores. ¿Es algo fundamental?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

El problema es que apachectl envía su salida a STDERR en lugar de STDOUT. Por lo tanto, debe redirigir STDERR de la siguiente manera:

 apachectl -t > /tmp/apache_config_check 2>&1

El 2>&1 es magia de script de shell que dice "redirigir la salida en el descriptor de archivo 2 (STDERR) al descriptor de archivo 1 (STDOUT)".

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!