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

  • Home
  • SEARCH
  • 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 6815433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:48:24+00:00 2026-05-26T20:48:24+00:00

system(do_this); // which executes an external program to output a phrase on the screen

  • 0
system(do_this); // which executes an external program to output a phrase on the screen
printf("=My taxes");

Output:

500$

=My taxes

Expected output:

500$=My taxes

I don’t have control over the code executing in do_this which automatically outputs the '\n'.

  • 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-05-26T20:48:25+00:00Added an answer on May 26, 2026 at 8:48 pm

    This should work:

    system("program | tr -d '\012\015'");
    printf("=My taxes\n");
    

    where program is the program you want to run. The tr command removes all CR and LF characters (codes 015 and 012 octal) from program‘s output. The solution assumes program only outputs one line (your tax) and it works on systems with line endings CR, LF, CR+LF, LF+CR (includes all widely used operating systems like MacOS, Linux and Windows).

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

Sidebar

Related Questions

Here's what I do: double x = 7.0; System.out.printf(%.2f, x); Eclipse gives me this
What is happening now, is that .bat files are ran on logon, which executes
I'm making a small Python program, which calls the webbrowser module to open a
We're currently building an application that executes a number of external tools. We often
When starting the external program (let's call it EX for brevity) from within Matlab
There is one thread which executes say 50 methods across several packages. I want
I have VBScript code which launches QuickTest Professional, executes a series of QTP tests,
I am currently creating a quote system which works like this: User submits data
How does one do this? The SYSCOLUMNS system table only has columns for tables.
I want to do this: MethodInfo m = myList.GetType().GetMethod(ConvertAll, System.Reflection.BindingFlags.InvokeMethod).MakeGenericMethod(typeof(object)); List<object> myConvertedList = (List<object>)m.Invoke(myList,

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.