1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

A small change

Discussion in 'Support' started by vefatica, Jan 6, 2013.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,794
    Likes Received:
    29
    I noticed a small change; I believe it came with the latest update. TASKLIST now identifies the current TCC like this, for example.
    Code:
    3704  * tcc              14.03  [3704]  v:\
    Whereas, in v13 (and I think more recently) it was like this.
    Code:
     3492* tcc              13.04  [3492]  v:\
    I don't mind where the asterisk goes but I don't like the extra word.

    P.S. (a suggestion) Yesterday I was struggling a bit with the WORDS in TASKLIST's output and thought it would be a nice touch if @WORD[] accepted open-ended ranges, like this.
    Code:
    v:\> echo %@word[1-,My dog has fleas]
    dog has fleas  (desired)
    where "N-" gives all words from word N on.
    If it's already meant to do that, then it doesn't quite get it right.
    Code:
    v:\> echo %@word[1-,My dog has fleas]
    dog has  (actual)
    Nor does it do anything consistent.
    Code:
    v:\> echo %@word[0-,My dog has fleas]
    My
    v:\> echo %@word[2-,My dog has small fleas today]
    has small fleas
    It seems if you specify "N-", you get N+1 words starting at word N.
     
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    You can specify %@word[2-9999,string] to specify words 2 through 9999, which displays the rest of string if it has fewer than 9999 words. Admittedly it is not as nice as your suggestion, but you could already do it many versions ago.
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,794
    Likes Received:
    29
    Yesterday I tried something like that and was convinced it didn't work. This works fine; every line has a WORD_1:
    Code:
    v:\> do l in /p tasklist ( echo %@word[1,%l] )
    [System
    System
    smss
    csrss
    *** SNIP ***
    But when I ask for words 1-2 (or 1-9999) I don't even get word 1. What's happening here?
    Code:
    v:\> do l in /p tasklist ( echo %@word[1-2,%l] )
    [System Process]
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    taskhost          Task
    dwm              DWM
    explorer          Program
    ECHO is OFF
    winpm-32          Pegasus
    powerpro          Physimem
    OUTLOOK          RE:
    ECHO is OFF
    firefox          A
    * tcc
    ECHO is OFF
     
  4. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    Sorry, on my 32b WinXP SP3 TCC 14.03.54 no such problem occurs. My Win7 x64 system is not set up yet...
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,794
    Likes Received:
    29
    Steve, did you try those exact commands? "1-9999" does work in simpler cases.
     
  6. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    Copy and paste...
     
  7. Frank

    Joined:
    Aug 2, 2011
    Messages:
    258
    Likes Received:
    4
    The problem seems to be, that the function @word doesn't handle the error which occurs when you use "1-99" or "0-2" but the string has less words than requested.
    But otherwise this works:
    Code:
    echo %@word[4-99,My dog has small fleas today]
    
    No idea.
    This is also funny (here I tried it with a textfile):
    >do line in @tasklist.txt ( echo %@word[0-2,%line] )
    0 [System Process]
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    1948 vmware-usbarbitrator64
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF
    ECHO is OFF

    The short lines have trailing spaces, e.g. "123 svchost ".
    The long ones do not.
    Haha:
    Code:
    >do line in @tasklist.txt ( echo %@word[0-2,%@trim[%line]] )
    0        [System Process]
    4        System
    344      smss
    508      csrss
    560      psxss
    580      csrss
    592      wininit
    644      services
    676      winlogon
    696      lsass
    704      lsm
    812      svchost
    888      svchost
    1004    MsMpEng
    524      svchost
    392      svchost
    904      svchost
    1104    svchost
    1304    svchost
    1408    svchost
    1532    spoolsv
    1580    svchost
    1616    svchost
    1752    dsAccessService
    1848    svchost
    1868    svchost
    1964    PassThruSvr
    2008    svchost
    2032    svchost
    1136    TCPSVCS
    412      USBDLM
    1948    vmware-usbarbitrator64
    2064    vmnat
    2108    vmnetdhcp
    
     
  8. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,794
    Likes Received:
    29
    Frank, I think you found the culprit ... separators at the end on the string (see other thread about @WORD).
    Code:
    v:\> echo %@word[1-9999,PID scvhost]
    scvhost
     
    v:\> echo %@word[1-9999,PID scvhost ]
    ECHO is OFF
     
    v:\> echo %@word["-",1-9999,PID-scvhost]
    scvhost
     
    v:\> echo %@word["-",1-9999,PID-scvhost---]
    ECHO is OFF
     

Share This Page