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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:18:10+00:00 2026-06-12T01:18:10+00:00

Lake a look at this two lines case 1 set cvsUpdStr [exec cvs -qn

  • 0

Lake a look at this two lines

case 1

set cvsUpdStr [exec cvs -qn upd]

case 2

set cvsUpdStr [exec cvs -qn upd >&@stdout]

For the first case cvsUpdStr is the output of the command, but there is nothing printed out during command execution. For the second case the cvs upd command output is printed on the screen, but cvsUpdStr is empty. How to combine them so that it will print out the result of cvs upd and also will store the same output in cvsUpdStr variable?

  • 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-12T01:18:11+00:00Added an answer on June 12, 2026 at 1:18 am

    There are two possibilities. Either run it as a pipeline (created with open |...) and handle the messages as they come in by storing them and printing them, or use the Unix tee utility. The second alternative is definitely simpler!

    # I like to spell out “update” in full
    set cvsUpdStr [exec cvs -qn update | tee /dev/tty]
    

    The tee program sends its standard input to its normal standard output plus the named file; we use /dev/tty to send it to the current terminal.

    Note however that you may get long delays in the output of cvs due to it buffering its output. This is just the default behavior of the C library’s I/O handling when sending output to a non-terminal, and can be a problem if you need the output instantly. Fixing this gets quite involved (you end up using Expect) so if you’re happy with the output being bursty, just leave it alone…


    On Windows, you need to do it the other way.

    set pipe [open |[list cvs -qn update] "r"]
    while {[gets $pipe line] >= 0} {
        append cvsUpdStr "$line\n"   ;# Note the \n at the end!
        puts $line
    }
    close $pipe                      ;# Any errors turn up here!
    

    The construct with |[list ...] is rather unusual in Tcl terms, but it is the correct one to use in this situation. (If the first character of the “filename” to open is a |, the rest of the argument is treated as a list of arguments to use for building a pipeline.)

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

Sidebar

Related Questions

function tournamentViewModel(){ var self= this; self.name = ko.observable(); self.districts = ko.observableArray([new district('Provo',1),new district('Salt Lake
Consider the following two (hypothetical) tables Temperature * day * time * lake_name *
I am not quite sure where to start with this. I only just started
I guess its just due to my lake of jquery knowledge but ill lay
Well, I think my problem originates in a lake of knowledge of basic C++
Why is this the extended ascii character (â, é, etc) getting replaced with <?>
My question has to do with facetting. In my example code below, I look
here this is below the code i need to parse the section and Company
The answer to this question is probably quite simple - but I'm stumped. I
Given a set of sixteen letters and an English dictionary file, need to find

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.