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

"pathlist" alias

Discussion in 'T&T - Aliases' started by mikea, Aug 15, 2013.

  1. mikea

    Joined:
    Dec 7, 2009
    Messages:
    213
    Likes Received:
    2
    I hate having to examine the %path% the usual way -- cluttered, barely human-readable. To view it with only one path shown per line, I use this alias: pathlist=echo %=n %@replace[;,%=n ,%path]

    This starts by replacing every ";" in the %path% with "%=n" (a "newline") followed by a single space. The first characters following "echo" are: newline + single space. The display looks like:

    C:\> pathlist

    C:\Perl\site\bin
    C:\Perl\bin
    C:\Program Files (x86)\AMD APP\bin\x86_64
    C:\Program Files (x86)\AMD APP\bin\x86
    C:\TakeCommand
    C:\Windows\system32
    C:\Windows
    [etc.]


    Apologies if something like this has already been posted in some other thread. (Edit: the leading spaces don't appear above because, I guess, the forum software "eats" them before posting a message.)
     
    #1 mikea, Aug 15, 2013
    Last edited: Aug 15, 2013
    redwdc likes this.
  2. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    697
    Likes Received:
    8
    Thanks for that one.

    I have added it to my alias.lst file.

    Joe
     
  3. mikea

    Joined:
    Dec 7, 2009
    Messages:
    213
    Likes Received:
    2
    I also got extremely irritated with the idiotic Windows path-setting routine — I mean, is it still 1995 or something? Year after year the same thing: one tiny, cramped, single-line text field buried three or four dialog boxes deep. Ridiculous. So, after making a file 'pathlist.txt' that looks like the output of the "pathlist" alias, I added this to the startup script (which does not have a "setlocal" command):
    Code:
    echo  Loading path from %pathFile
    set path=
    do _thisline in @%pathfile
        set _thisline=%@trim[%_thisline]
        if "%_thisline" == "" ITERATE
        iff "%path" == "" then
          set path=%_thisline
        else
            set path=%path;%_thisline
        endiff
    enddo
    Editing the path no longer requires using that awful dialog box — or having to use "eset path," which is handy to have at the command line but is still pretty cluttered. I just have to edit the pathlist text file. (I see I should add to the above a test for whether a line contains only a semicolon.)
     
  4. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,054
    Likes Received:
    30
    Do you mean the ControlPanel\System\Advanced\Environment dialog? There you only set it once (as opposed to every time you start TCC).

    And if you do want to set it every time you start TCC, why not just a single line in TCSTART.BTM?
    Code:
    set path=%path;...;...
    Editing TCSTART.BTM seems no harder than editing PATHLIST.TXT.

    And you can do the equivalent of using the CP applet with a simple
    Code:
    set /u path=%path;...
     
  5. mikea

    Joined:
    Dec 7, 2009
    Messages:
    213
    Likes Received:
    2
    I want to be able to see one path "item" per line. It makes reading the whole collection of them — and editing them — easy. This way, I have it all ways: path is loaded; path is configured easily; the whole thing is very readable. Long lines of semicolon-separated paths don't appeal to me. Just personal preference. And although it's true that it is set every time I start TCC, the fact that it's being set is completely invisible to me. It happens instantly and automatically. Now if this approach somehow forced me to do it manually every time I started the command processor — that'd be a different matter entirely.
     

Share This Page