| T.R | Title | User | Personal Name
 | Date | Lines | 
|---|
| 3062.1 | Shot in the dark | TLE::RMEYERS | Randy Meyers | Tue Oct 31 1989 10:28 | 6 | 
|  | Re: .0
A random guess here:
Is the Alias end endcli the last line of your shell-startup?  Does
that line end with a newline?
 | 
| 3062.2 | Reboot? | DICKNS::MACDONALD | WA1OMM 7.093/145.05/223.58 AX.25 | Tue Oct 31 1989 10:37 | 12 | 
|  | >>    In my shell-startup I define the following alias
    
>>          Alias end endcli   (or endshell, I've tried both)
    
>>    when I run the shell, I get no complaints but the "end" alias
>>    did not take.  It doesn't show up in the alias list.
Did you reboot after modifying your shell-startup file?
-Paul    
 | 
| 3062.3 |  | TLE::RMEYERS | Randy Meyers | Tue Oct 31 1989 10:52 | 6 | 
|  | Re: .2
>Did you reboot after modifying your shell-startup file?
There's no need to reboot.  Any new shell reads the shell-startup from
s: when it starts up.
 | 
| 3062.4 | .re  .1 .2 | HPSCAD::GATULIS | Frank Gatulis | Tue Oct 31 1989 10:55 | 16 | 
|  |     .re .1
    
    No Randy, the alias was somewhere in the middle of others.
    
    .re .2
    
    It so happend I did reboot but that was coincidence.  Why in the
    world would I have to reboot anyway?
    
    
    A thought!
    Maybe there's something there that's case sensitive!  Don't know
    but I've been burned by that before.  I'll try more experiments.
    
    Thanks
    
 | 
| 3062.5 | Do you have an <e> alias also ? | KETJE::VLASIU | Try with a bigger hammer | Tue Oct 31 1989 10:57 | 9 | 
|  |     Ref. .0
    Hello,
    I'm using "alias end endcli" (endshell is an alias for endcli I think)
    and it works fine but at a moment I remember I had problems with alias.
    I had a Xaaa alias and I have also introduced an X alias. My Xaaa
    disapeard from the alias list. So if you have an "e" for edit after the
    "end" alias it may be the same case.
    Regards,
    Sorin
 | 
| 3062.6 | ORDER OF ALIASES IS IMPORTANT | POLAR::GOSLING |  | Tue Oct 31 1989 11:29 | 25 | 
|  |        .5 is on the right track.  The order that you place 'like' aliases
       (an alias name which is a subset of another alias name) is
       important.
       
       I had the same problem described in .0 with a bunch of PRINT
       aliases.  If I did this (syntax may not be exact):
       
       alias printwide dh0:utilities/print [] cpi16
       alias print     dh0:utilities/print [] cpi10
       
       One of the aliases wouldn't 'take' (don't remember which).
       
       If I reversed them, i.e.
       
       alias print     dh0:utilities/print [] cpi10
       alias printwide dh0:utilities/print [] cpi16
       They both 'took'.
       
       Sorry, but I can't remember if it was the PRINT or PRINTWIDE that
       wouldn't take in the first example.  Regardless, reversing the
       order worked.
              
       Art
       
 | 
| 3062.7 | And the answer is .... | HPSCAD::GATULIS | Frank Gatulis 297-6770 | Tue Oct 31 1989 20:37 | 59 | 
|  |     
    Well I did some experiments and believe I've emperically discovered
    the algorithm for the way alias commands are inserted in the active
    list when read from the shell-startup.   I don't know why its's
    like this, but it is, and I think it's a bug.
    
    See if I can explain .... Logically - the following happens
    
    Each time a new alias command is read from shell-start up it is
    added to the existing list and then a hokey algorithm is applied
    to see if the new command should cause a previous one to be dumped.
    The algorithm matches the text of most recent command against the
    text of the previous commands (in the same order they were read
    in).  Here are the rules of this silly game:
    
    1.  If the text of the most recent command is contained in ONLY
        ONE previous command, the earlier command is dumped.
    
    2.  If the text of the most recent command is contained in MORE
        THAN ONE of the previous commands,  ONE (AND ONLY ONE) of the
        previous commands will be dumped: 
          - If the previous commands are of UNEQUAL LENGTHS, the
            shortest one is dumped.
          - If the previous commands are of EQUAL LENGTHS, the one
            alphabetically closest to the most recent command is 
            dumped.
    
    Simple as that ..... Here's an example of a list of alias cmds
    contained in shell-startup and what remains after the algorithm:
    
    Sample List       Result
    ------------      ------
    alias extent ...   alias alpha ...
    alias editor ...   alias e ...
    alias alpha  ...   alias end ...
    alias end ...      alias ex ...
    alias ex ...
    alias ed ...
    alias e ...
    
Heres why ....
    1. first problem encountered when "ex" is read in.  "ex" found in
       "extent" so "extent" is dumped.
    2. next problem - "ed" found in "editor" so "editor" is dumped.
    3. finally "e" is found in "end, ex, ed" and "ed" is dumped.
       "ed, ex" become candidates for dumping and "ed" is closer
       alphabetically to "e".
    
    What's the point?  Knowing this, it's simple to order your alias
    commands so they ALL work as expected.  Seems as if simply ordering
    the list by length of command is fullproof.
    
 Thanks to everyone for putting me on the right track.  It's simpler than
 it looks and I hope it clears up confusion for other folks.
    Frank
    
    
 |