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 152515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:38:14+00:00 2026-05-11T09:38:14+00:00

I am redirecting the g++ compiler output(both stderr and stdout) to a file on

  • 0

I am redirecting the g++ compiler output(both stderr and stdout) to a file on linux. But it is creating an empty file.

I read in some other post that stdout is not flushed after every line. Thats ok, but what about stderr. In my case there are compilation errors running several screens. So, I am interested in stderr output. There is no stdout output created.

 g++ -c -I ~/cplusplus/boost_1_37_0/boost_1_37_0/ -I  ~/cplusplus/niVxWorksDeliver/TEES/ Algorithms.cpp 2> output 

The above command creates an empty file named ‘output’. The following command reports invalid null command.

 g++ -c -I ~/cplusplus/boost_1_37_0/boost_1_37_0/ -I     ~/cplusplus/niVxWorksDeliver/TEES/ Algorithms.cpp &> output Invalid null command. 
  • 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. 2026-05-11T09:38:15+00:00Added an answer on May 11, 2026 at 9:38 am

    One of your comments betrays that you are not using bash. You’re using csh or tcsh. In that case, you can redirect all output (including standard error) like this:

     g++ -c Algorithms.cpp >& output 

    For more csh redirection syntax, I have a useful link bookmarked. Note that csh redirection syntax is not as fluent as bash syntax. You can do more in bash than you can in csh.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some strange behavior redirecting stdout and stderr from s3cmd. For example: $
I am redirecting some output to a file in three different ways and each
I'm looking for an example of redirecting stdout to a file using Perl. I'm
Is it possible to combine redirecting output to a file and pipes with ||?
I'm redirecting console output to a file, and getting [?25h and [?25l mixed in
I have my htaccess redirecting to a error404.php but I want that PHP file
I am redirecting from one action receive to other show using redirect_to @post I
I've been trying to get a program's STDOUT redirecting to a file. So far,
Redirecting sys.stderr to a text file in IPython and console(Gnome terminal) yields different results.
After redirecting standard input and output to some files(for example) using freopen how can

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.