Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7798061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:53:15+00:00 2026-06-01T23:53:15+00:00

I recently found a post that gave a solution to have the text output

  • 0

I recently found a post that gave a solution to have the text output by stderr a different color for Linux (bash)

They created the following bash script script

#!/bin/bash
{ $* 2>&1>&3|sed 's,.*,\x1B[33m&\x1B[0m,'>&2;} 3>&1

this causes the output to print yellow text when it is from stderr. stdout still prints the same color.

the script was saved in a directory on $PATH called color. This allows me to run the script with make or scons and it will hi-lite all of the text from stderr in yellow. (could make the text red by changing 33m to 31m)

color make CPU=x64 

This is quite useful for finding errors when compiling.

Is there a similar script that could be used for Windows cmd shell?

Note: I have sed installed on my windows computer if that is helpful.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T23:53:17+00:00Added an answer on June 1, 2026 at 11:53 pm

    As for support for ANSI escape codes under Windows’ cmd.exe, see ansicon. After translating your redirection logic to cmd.exe syntax I prepared the following color.bat file:

    @Echo Off
    (((%* 1>&3) 2>&1) | "c:\Program Files (x86)\GnuWin32\bin\sed.exe" "s,.*,\x1B[33m&\x1B[0m," 1>&2) 3>&1
    

    Unfortunately the streams get mixed (on some lines the characters from stdout and stderr are mixed together in single line). Maybe this behavior depends on version of sed.exe used, so give it a try.

    If this does not work, consider using a minimum cygwin install. I tested your color.sh script and I was able to launch a .bat file and it worked correctly without mixing streams. The syntax I used was:

    ./color.sh cmd /c test.bat
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently found this post . It basically says that Eclipse has a modified
We have recently got a client that have the ability to send files (text
I have recently found myself on a Linux computer and am liking it so
I recently found a log statement in my projects codebase that says here i
I recently found myself writing a piece of code that executed a Core Data
I recently found an article online that told me about this: RewriteRule ^mock-up/([^/]+)/([^/]+) /mock-up/index.php?page=$1&section=$2
The sad truth about this post is that I have poor regex skills. I
Recently I have a new project that uses Box2D as physics engine. And I
I have 2 applications on Dreamhost using Rails 2.1.0, recently they installed Rails 3
I recently came across http://chromeexperiments.com/ . I found a couple of projects there that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.