FreeCOM feature review: ALIAS
Eric Auer <[email protected]> Mon, 11 Nov 2002 03:38:15 +0100 (MET)
| Newsgroups | gmane.os.freedos.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, just a short mail telling you that I have: ForDo.bat: @echo Usage: FORDO command filespec arg2 arg3... @for %%f in (%2) do %1 %%f %3 %4 %5 %6 %7 %8 %9 @echo Done. FDAlias.bat: @echo off echo Setting up ALIASes. Type ALIAS to view a list! rem alias go=locate %1 /d+ /g /n rem does not work, because alias does not process %1 and rem locate must have filespec as FIRST argument rem so I must keep using GO.EXE which only searches the current drive! alias dsk=volinfxl alias l=ls-none -lSar alias ls=drl /t /1 /o=con rem type ls /o to enable pager :-) (works even with /o=con /o) alias mp3=fordo dosamp alias fli=fordo fli_play alias wav=fordo wave_sb8 alias mod=fordo play_22 alias inf=for %%f in (readm* liesmic* *.txt *.do? *.diz *.me) do list %%f alias goding=for %%f in (*.com *.exe *.bat) do ? %%f And am generally happy about it! But I wonder if it is possible to auto-load the aliases (not by simply call fdalias.bat in fdauto.bat / autoexec.bat but by something that even works for NEW instances of FreeCOM, for example when I shell out from TED3 (tiny editor: TSR is 14k plus 64k data for the file - no matter how big is in reality - plus 64k data for the editor itself, also probably unneccessarily big). ALIAS just works like "whenever the command starts with FOO, and there is an ALIAS FOO=BAR..., pretend that the line would have started with BAR...". So you cannot play around with command line arguments or anything. LS-NONE is GNUish LS which I have binary patched to not display the user name and group name, evil me. I know that I could have better recompiled it. DRL is the sorting colored directory lister that I have been talking about. As I want to avoid | and > with aliased commands, I remember that DRL /t /1 /o=con /o acts like DRL /t /1 /o which acts like DIR /od /p apart from /od not being implemented yet in FreeCOM. So instead of DIR /od /p *.txt I can now type LS /o *.txt ... Aliases override other files: If there was an LS.EXE, I would have to type "LS.EXE ...", because if I had typed "LS ...", the alias would have been activated. Aliases even override internal commands: If you do not like the workings of FreeCOM DIR, you can ALIAS DIR=MYDIR.EXE or something like that :-). To get back the internal DIR, you must either ALIAS DIR= to remove the alias, or type *DIR instead of DIR (this works like typing \LS in Unix BASH to avoid an LS=... alias being triggered). Some other points worth mentioning: LOCATE is very nifty (to run non-interactively to GO to the first directory that matches the filespec, use /f1 in addition to /d+ (only directories) /g (go there) and /n (non-verbose output) to form a command like: locate jazz* /d+ /g /n /f1 where jazz* is the name of the directory you want to search for and go to). BUT it does not allow the filespec to be anything but the FIRST command line argument. So I cannot use ALIAS to create my GO command. I must either use GO.EXE (freeware, but searches only one drive) or write a BATCH file like: LOCATE %1 /d+ /g /n which is kind of too short to be worth a batch file. So I hope locate gets improved to allow: locate /d+ /g /n /f1 jazz* which would be great :-). FLI_play is a FLI animation player which I have written. Does not support the full FLI language, but it was fun to write it. Now I can play FLI anims inside other programs that I have written without needing to start an external program. Well, I actually never wrote more than one such program, but that program shows the FLI in a window, which some DOS quickfli.exe or similar would not have allowed... WAVE_SB8 just throws a stream of bytes into the soundblaster DSP. Not worth being called a WAVE player. I probably wrote this as a quick hack directly in DEBUG. DOSAMP is DOSAMP, as I did not know DAMP at the time (and DAMP does not run stable for me). PLAY_22 is the Inertia Player. I have another .exe that has another name and is configured to use the internal speaker, but is also the Inertia Player. Plays .mod files featuring scopes, FFT and a DOS SHELL, so you can work in Dos while listening to a mod tune :-). LIST is the German freeware version of LIST 6.0, which displays file contents and allows scrolling and searching. I also have 6.1 in English, but it is shareware and contains some bells and whistles that I do not need. Play_22 falls back to using the internal speaker when BLASTER= is not set. The problem is that 22kHz of interrupts are too fast for Dosemu on my slow PC. However, I have the Linux program "tracker" to play .mod files :-). Speaking over Inertia Player: Version 1.10, by Stefan Danes and Ramon van Gorkom. For comments: [email protected], DemoNet 94:410/724, FidoNet 2:284/5.23 Cholera: 99:999/999.15 (not that I would remember how those old address schemes have worked!), mailing list is subject "subscribe Inertia-List" to [email protected] ... Or at least it has been!? My other MOD player in DOS is WOW (not WOWII). With Ctrl you reach the setup. You can set the sampling rate to as low as 7.5kHz and apart from the PC speaker there is also support for SB and various covox type D/A converters. Whatever. Hey, funny. When I set the output port of Wow to the video port /P:966, my Dosemu window blinks to the rhythm. Similar things happen when I do this in real DOS. Whatever. The internal speaker simulation of Dosemu does not love me today, and neither does the Soundblaster one :-(. Dosemu 1.0.2, by the way. Well, using Inertia Player at 6 kHz almost works :-).And of course my "copy foo.wav to internal speaker" tool produces sound, but way too slow. As said, Dosemu sound does not like me today. ... Eric PS: Conclusion: You can do nice things with a few aliases and some DOS tools.