 |
tzsh - a UNIX like shell for non-UNIX platforms |
Update June 2020 - Before you read on, the world has moved on since I coded tzsh back in the early 1990s. It was great then, but now there are many tools which
provide the same and even better features and are supported and modern. If you want a Unix/Linux like shell to run on Windows I can recommend:
UNIX is the most flexible environment to work in but
can be a bit cryptic to the uninitiated. However, if you know what
you're doing and what you want, then you can make the system fly, rather
than sit there waiting for the hard disk to stop spinning as you do
on Windows platforms...So...I wrote a low overhead UNIX environment for
non-UNIX machines so I could do all those things I knew could be done,
but which Windows makes so difficult.
Linux is of course a perfect alternative for home use,
and ever increasingly for business use too, but if you're stuck with Windows at least you
can now have a shell to work in.
Go directly to the section on using tzsh
Go directly to Examples
One pronounces tzsh as 'tee zed shell' (although in the US this will be 'tee zee'),
just as one says korn shell for ksh.
If you know UNIX (or Linux of course), you'll love this, if you don't then learn UNIX, it's for
your own good, really. It is said that ignorance is bliss, that's the
position you're in if you've only ever worked in Windows. Anyway, here's
my tzsh, an implementation of the brilliant ksh (Korn shell) of UNIX.
It's purely a character based environment, used by those in the know, otherwise
you won't like it...sorry but educate yourself, expand your horizons and
you'll become more accurate and efficient at what you do, hopefully leaving
more time for doing the serious stuff like surfing and playing games.
The release provided here is the freeware version and includes most of the
functionality of the full version, including the ability to run basic ksh scripts.
For full ksh script support (including a full expr facility) the registered version
will be required, but look at the examples in the etc directory download for what
this version supports. Also, in the freeware version not all of the command options
are supported, if you need a specific one check it out first, it's probably there.
Feel free to email me with any ideas, comments or requests, don't feel free to
email any junk or abuse.
Download a real o/s...
The usual disclaimers apply, i.e. The author does not accept responsibility
of any kind for any damage to your system or yourself through the use of software
provided on this site, bla, bla, bla, etc.
The Software
The kernel of tzsh has been made as portable as possible, ANSI and POSIX standards
adhered unless explicitly not possible to implement a shell feature on a given platform.
Conditional compilation has kept the build procedure simple for creating target executables.
However, hardware and environmental specifics have resulted in more than one version.
Due to the way Microsoft have implemented their thread/process models in
95/98 and NT there are two versions of tzsh for the windows platforms, otherwise
the environments are identical (the format of specific output may vary by platform).
The main executable - the shell
|
|
IMPORTANT NOTE: For WinNT and XP the TMP variable needs to be set to a path the user has access to and
where the path name is not mangled nor has any spaces without proper escaping. The default TEMP variable path in XP
for a normal user includes a space which causes a problem as tzsh uses this by default as the value for the TMP variable. Therefore
please set the TMP variable in the tzsh32.prf to something like e.g. TMP=c:/temp or TMP=c:/winnt/temp or similar.
|
With the intention of keeping installation as easy as possible (simply copy the desired files), I've kept the
kernel to tzsh as small as possible while still including as much functionality in the
main executable. I did created some of the UNIX support programs outside of the integrated
shell environment. There are several reasons for this, always to keep down resource usage but also include:
- The banner program has a large(ish) static heap and it would be crazy to include this into the
main environment.
- The top2 programs (resource monitoring) work best if they run
within their own process space.
- Service programs which are additions to the environment
make sense to keep out of the core environment, e.g. htmlcat which is
a text only browser.
To download the larger (bmp) version of this picture (which can be used as a backdrop)
select 'Save Target As' or 'Save Link', if you do a 'Save Picture As' or 'Save Image'
will save the smaller thumbnail (jpg) version only.
Try typing "backdrop tzsh.bmp" in the shell to see this appear as your wallpaper.
Why use this picture you ask, are you kidding! - thanks DC
By writing a simple shell script you can process all .bmp files in a directory, changing
the backdrop at specified intervals, see the tzshetc.zip directory examples.
The Documentation
UNIX man pages are a mix from IBM AIX, SCO, SVR4 (Unixware) and Sequent Dynix systems, all
of which I've worked on over the years (don't know why I've never used HP-UX).
|
Documentation and the MANual Pages
|
|
|
About Me
Simply place the files into any one of your utilities/tools type
directories. It helps if all the exe's are in the path but this
isn't a necessity. You can start the shell by clicking on it's icon
(in explorer or via a short cut) or typing tzsh32 or tzshnt from
the 'start menu - run' option. I suggest you put a short cut to the
core executable where you can easily find it, I've also added it to my
start menu, making it really easy to get to. Only one environment variable is a
requirement, TMP or TEMP, which points to where temporary files are stored.
Either one will be detected and used as TMP, you can also set a different
TMP environment for the shell by placing the command
TMP=mydir in the profile file, tzsh32.prf. For a full list of these and
other issues please read the documentation.
Full manual pages are provided by installing the manpages,
setting the environment variable MANPAGES to point to this directory (see tzsh32.prf for
an example). Then simply type 'man the_command_to_see' where 'the_command_to_see'
is simply the name of the command, e.g. 'man ls' for a complete manual on this
command.
The tzsh acts like a tty terminal providing a character based console environment in
which commands may be entered. Full support is provided for executing internal
shell commands, scripts, additional console and full windows programs, including the ability to
pass arguments to the programs by simply typing them in on the same line as the
executable name, just as in UNIX (or DOS). In fact, as far as the implementation allows,
whatever you can do in 'ksh' you can do in 'tzsh', including piping, filtering,
redirection of output etc.
As in UNIX, launched applications execute within and use the shell environment unless the
'&' character is added to their command execution string in which case they start a new
process/environment space (they take a copy of the system one). Windows programs may spawn their
own threads irrespective of this parameter. The 'ps -e' command allows you to keep
track of all processes or threads (this depends on 95/98 or NT), see tzsh.man and the manual pages in
general for a full rundown on commands and their options.
For more information on using tzsh go to examples.
I am a big fan of Linux, I use Mandrake release 9.0 at home, and RedHat 7.2 at
work. I've found some very nice features in bash (bourne again shell) so I plan to add many of these to tzsh. One of
the most useful will be the addition of mathematical expression capability to the let command
which currently only assigns what is on the right-hand-side to the left-hand-side.
Home