Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

add a new alias

Jun
19
0
To use this, you must have this command in your TCSTART.BTM file:

Code:
alias /r "c:\path\to\alias.ini"

And then in the alias.ini file, you keep all your commonly used aliases, e.g.,

Code:
calc=echo The answer is %@comma[%@eval[%$]]
clear=*cls
getclip=*type clip:

and then, assuming your favorite text editor is named TDE (Thomson-Davis Editor), add this next one:

Code:
addalias=tde c:\path\to\alias.ini %+ alias /r c:\path\to\alias.ini %+ echo New aliases loaded!
I am now able to edit aliases in a flash, instantly activate them, and save my changes so they will be active the next time I run TakeCommand. (Of course, if you don't use TDE as your editor, just replace it with whatever is a quick and preferably console-mode text editor.)
 
I do it just a little differently. After I create a new alias, I use an alias called save. It looks like:

Save = al>c:\4nt\alias.bak&type c:\4nt\alias.bak | c:\windows\system32\sort > c:\4nt\alias.txt&una *&alias /r c:\4nt\alias.txt

Where "al" is an alias for "alias".

Where "al>c:\4nt\alias.bak" writes the alias file to c:\4nt\alias.bak.
Then "Type c:\4nt\alias.bak | C:\window\system32\sort > c:\4nt\alias.txt" sorts the backup file alphabetically and writes it to the alias.txt,

Where una is an alias for "unalias".
Then "una *" removes all the aliases in memory.
Then "Alias /r c:\4nt\alias.txt" reloads the aliases.


I also have a "load.bat" file on the root of the C drive.
It is "alias /r c:\4nt\alias.txt"

I use it in the event that I modified an alias and it doesn't function properly. I simply type in "Load" and all is forgiven.
 
type c:\4nt\alias.bak | c:\windows\system32\sort > c:\4nt\alias.txt

can be rewritten as:

SORT /o c:\4nt\alias.txt c:\4nt\alias.bak

Looks cleaner and is somewhat faster....

----- Original Message -----
From: "harvey" <>
To: <[email protected]>
Sent: Sunday, July 26, 2009 06:06 PM
Subject: RE: [T&T - Aliases-t-344] Re: add a new alias



>I do it just a little differently. After I create a new alias, I use an
>alias called save. It looks like:
>
> Save = al>c:\4nt\alias.bak&type c:\4nt\alias.bak |
> c:\windows\system32\sort > c:\4nt\alias.txt&una *&alias /r
> c:\4nt\alias.txt
>
> Where "al" is an alias for "alias".
>
> Where "al>c:\4nt\alias.bak" writes the alias file to c:\4nt\alias.bak.
> Then "Type c:\4nt\alias.bak | C:\winddow\system32\sort > c:\4nt\alias.txt"
> sorts the backup file alphabetically and writes it to the alias.txt,
>
> Where una is an alias for "unalias".
> Then "una *" removes all the aliases in memory.
> Then "Alias /r c:\4nt\alias.txt" reloads the aliases.
>
>
> I also have a "load.bat" file on the root of the C drive.
> It is "alias /r c:\4nt\alias.txt"
>
> I use it in the event that I modified an alias and it doesn't function
> properly. I simply type in "Load" and all is forgiven.
>
>
>
>
>
 
I use an interpreter written in REXX to update the alias list. This allows aliases to propegate across versions (4NT, tcmd, tcc), and dos versions (10.50 = 2k, 10.51 = xp, 10.52 = xp64).
 
| I use an interpreter written in REXX to update the alias list. This
| allows aliases to propegate across versions (4NT, tcmd, tcc), and
| dos versions (10.50 = 2k, 10.51 = xp, 10.52 = xp64).

Do you mean you have a different set of aliases for each combination of
different OS version and different JPsoft command processor version?

I use only a single OS version (XP, though home edition on my desktop
and pro on my laptop), but I have batch prgorams that have OS version
dependent behavior. OTOH I use a single instance of shralias.exe, which
allow me to share the same aliases for all 4nt/tcc versions from V6 up.
Admittedly, there are a few which will not work properly in older versions.
Of course, I only go back to V9 or earlier when I want to compare old and
new behavior of features, so this is not a practical issue. I have a batch
program NEWALIAS which invokes my favorite editor, concurrently editing the
4 files containg all my alias definitions - 3 loaded with the ALIAS/R
option, general.ali, laptop.ali and desktop.ali, and keyalias.btm - I found
that key aliases are not easily loaded from a definition file. The batch
program saves the old definitions, and after editing clears the old ones,
loads the new ones, and uses LIST to display the differences. I also have an
alias REALIAS, which just clears existing aliases, and reloads them all.
Since all my aliases are global, this affects all instances of 4ntv6 through
the latest TCC.
--
Steve
 
At the moment it's pretty much the same for different operating systems.

It's a 4NT command, using EXTPROC to a rexx script (weave.rex). Weave itself is a home-grown command processor, based on the notion that lots of documentation can be included in the code, without causing this to spill into the output files. The source for weave.rex is written in a miniture version of weave.rex.

The particular file shows the distribution of files to different copies of 4nt and tcmd (8.01), for both Windows 2K (on g:\) and XP (on h:). This version of 4nt/tcmd can operate out of the same directory, but different versions are kept for different operating systems.

Variables beginning in Y or Z in the rexx code can be directly used in the command, you can only !set variables in Y, though. !inc includes the code under the label. !new writes a new file for output, and !put puts an evaluated string to the command line.

For evaluation, strings are qTextqMoreqq, where q is the opening character (usually #) and a repetition of that character sets a line-end. Strings in Y or Z are tested for known values first.

In the example below, i write aliases for 4NT and TCMD for both Win2k and WinXP. The main differences are that the files are in different locations, and that 4NT and TCMD use different file names (TCSTART.BTM etc). Different aliases may be needed for different processors, so eg "fcw", a text-based norton commander clone for OS/2 and Windows, is not particularly relevant in TCMD, so it could have a special startup.

One can see, eg in the aliases section that "user:" is set differently for different instances of the operating systems. The line !put #user:=#yuser## is evaluated to user:=g:\users\wendy for 2K and k:\user\wendy for XP. Were there a need for desktop, we might put !put @desk:=@yuser@\desktop@@ for both. (the field character is the first one, "zhash" will create such a character if used. ZNUL or ZNULL creates an empty field.

Code:
extproc weave.rex

!src
!rem ; win 2k on g:
!set yuser #g:\users\wendy##
!set ypath #g:\save\newin\jpsoft##
!inc jpbtms  ; winxp on h:
!set yuser #h:\users\wendy##
!set ypath #h:\save\newin\jpsoft##
!inc jpbtms
!end

!src jpbtms
!new #ypath#\4start.btm
!put #@echo off##
!inc startnt
!new #ypath#\tcstart.btm
!put #@echo off##
!inc starttc
!new #ypath#\alias.4nt
!inc aliases
!inc alias4nt
!new #ypath#\alias.tc
!inc aliases
!inc aliastc
!new #ypath#\environ.4nt
!inc environ4nt
!inc environs
!new #ypath#\environ.tc
!inc environtc
!inc environs
!end

!topic 4start
!src startnt
!put #alias /r #ypath#\alias.4nt##
!put #set /r #ypath#\environ.4nt##
!lbl starttc
!put #alias /r #ypath#\alias.tc##
!put #set /r #ypath#\environ.tc##
!end


!topic Aliases
!src aliases
dl:=m:\download
cdata:=h:\save\cdata
!put #user:=#yuser##
clipdesc=describe %1 /d"%@clip[]"
drives=echo %_drives
!lbl alias4nt
!lbl aliastc
!end

!topic Environment
!src environs
.rex=regina.exe
.cmm=secon32.exe
!lbl environ4nt
!lbl environtc
!end

!end
 
Back
Top