Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Aug 2014
    Posts
    123
    Thanks
    19
    Thanked 0 Times in 0 Posts

    Batch echo command line questions

    Is there a limit on the number (18) of lines that can be echoed to the screen in batch?
    I have 23 lines to output but at the 18th I get "ECHO is on." and the 18th line of 23 is omitted. A search for just an echo command by itself proved none existed.
    I cannot find a reason for this so UR help is welcomed.

    While at it is there a way in Batch to break an echo command line text or create one without a carriage return at the line end (like echo -n in bash)?

  2. #2
    Silver Lounger RolandJS's Avatar
    Join Date
    Dec 2009
    Location
    Austin metro area TX USA
    Posts
    1,735
    Thanks
    95
    Thanked 128 Times in 125 Posts
    I used to do many batchfiles back in my earlier DOS & WFW 3.11 days. Can you give me a piece of that batch file -- maybe 2-3 lines "above the error" and maybe 2-3 lines "below the error?" I'm trying to visualize what you are almost successful in doing
    "Take care of thy backups and thy restores shall take care of thee." Ben Franklin revisited.
    http://collegecafe.fr.yuku.com/forum...-Technologies/

  3. #3
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Spark,

    Here's an innovative solution. HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  4. #4
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,421
    Thanks
    33
    Thanked 195 Times in 175 Posts
    The reason you get the message "ECHO is on." always seems to be because you have a line which just has ECHO with no text following.
    As RolandJS says, it's necessary to see the area around where the problem occurs to diagnose it.

    Of course ECHO. and ECHO/ and ECHO( and a whole bunch of other possibilities, just creates a blank line on the screen, if there is no text following on that line.

    With regard to ECHO-ing with no carriage return, I have an old 27-byte COM file called ECHONOCR.COM, but since that is (clearly!) 16-bit, it's not going to work on 64-bit systems, sadly.

    As to "breaking an ECHO command line text", you can use the ^ character to cause 'continuation' of one line with the next, as in
    ECHO This is the first piece of text we are echoing, ^
    and this is what follows

    This will result in a single line on the screen.
    Of course, this is not probably what you want!
    BATcher

    Time prevents everything happening all at once...

  5. The Following User Says Thank You to BATcher For This Useful Post:

    spark55 (2015-04-22)

  6. #5
    2 Star Lounger
    Join Date
    Aug 2014
    Posts
    123
    Thanks
    19
    Thanked 0 Times in 0 Posts
    The problem was resolved when I discovered a typo amongst the 80 odd lines of code set-TING the variable assigned to the echo by pulling the code out of the script to a separate file to test. Whew!
    TNX 4 the tip on continuation!! IT IS SO MUCH EASIER iin BASH!!!
    This is what I call self flagellation. But we push on.
    BTW I copied a list of escapable characters and their escape symbol so got that solved for now. The # seems left field for now.

  7. #6
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,421
    Thanks
    33
    Thanked 195 Times in 175 Posts
    Programming is almost always easier in the language you are best at!
    BATcher

    Time prevents everything happening all at once...

  8. #7
    WS Lounge VIP access-mdb's Avatar
    Join Date
    Dec 2009
    Location
    Oxfordshire, UK
    Posts
    1,726
    Thanks
    147
    Thanked 156 Times in 149 Posts
    For me the problem was that I programmed in a number of languages and it got to the point I started putting commands from one language into another. Made for interesting debugging!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •