The commands described here are also listed when the shell command usage is invoked.
The path command is an alias (=doskey macro) to the pathlist command. Therefore when you enter the path command interactively you actually start the pathlist command.
The cd command is an alias (=doskey macro) to the godir command. Therefore when you enter the cd command interactively you actually start the godir command.
Furthermore the ret command can return to directories visited using the godir command.
The godir command also understands labels, see lpath(3) for more information on labels.
The custom files in the scripts directory var/scripts/ are also searched for usage entries. The usage of executables or 3rd party scripts can be listed in the var/scripts/usage-scripts.list file.
Invoke usage -h or usage -t to display the required usage entry format in scripts or in the usage-scripts.list file to enable the usage command to query/list the entries.
Ever wondered which program has a particular file or directory open? Now you can find out. handle is a utility that displays information about open handles for any process in the system. You can use it to see the programs that have a file open, or to see the object types and names of all the handles of a program.
The usage idea is the following:
lsmv > t.bat vi t.bat t.bat del t.bat
or:
lsmv > t.bat np t.bat t.bat del t.bat
where first a list of move (mv) commands are written to a temporary batch file which is loaded to the vi or np (=notepad2) editor and the target names of the move commands are adjusted.
Then the batch file t.bat is executed what would rename the files. Finally the batch file is removed again.
The usage is analogous to the lsmv command.
Hint: If you like to quickly add line numbers to a file, use the -n option.
The filter file is an awk(3) or gawk(3) script that has to be located in the WA2LWinTools/var/scripts/ directory. The file name format is tf.filter.awk to be handled with the tf command.
This helps to get a quick overview of the revision and the last revision history entry of files located in a certain directory.
The file header must have the format:
[##] DD.MM.YYYY INi Revision history text
Example Windows™ batch file:
@echo off rem rem sav.cmd - save file to file.<TODAY>.suffix rem rem [00] 17.03.2007 CWa Initial Version rem [11] 07.12.2016 CWa chg: usage message rem
Example configuration file:
# # C:\Windows\System32\drivers\etc\hosts - host names # # [00] 28.02.2001 ??? Initial Version # [01] 28.02.2001 CWa +rh7ws001 # # 127.0.0.1 localhost 192.168.75.1 rh7ws001
The files with the following suffixes are resolved: .1, .1m, .3, .4, .ada, .asm, .au3, .awk, .bas, .bat, .bib, .c, .c++, .cfg, .cmd, .conf, .cpp, .cs, .css, .dat, .dok, .dem, .ebnf, .go, .gpl, .htm, .html, .inc, .index, .ini, .java, .js, .ksh, .list, .log, .lua, .map, .md, .md5, .meta, .opt, .pas, .ps1, .py, .sh, .sql, .tcl, .tpl, .tex, .txt, .var, .vbs, .ver and .xml.
To add more suffixes to be resolved, set the SUFFIXES=.suff_1;.suff_2;.suff_n setting in the etc/revision.cfg file.
This helps to get a quick overview of the purpose of files located in a certain directory.
The file header must have the format:
filename - the description text
or:
path/filename - the description text
Between the filename , the - and the description text has to be only one space each.
The filename has to be identical to the real filename but differences in upper-/lowercase are ignored.
Example SQL script:
-- -- TopTen.sql - Reports lists DB statistics -- -- [00] 31.1.2003 CWa Initial Version -- select a.tablespace_name, a.bytes/1024 as total_kbytes,
Example C++ program file:
/* * Commands\timedat\indent.cpp - print indented stream * * [00] 07.02.2014 CWa Initial Version * [01] 08.02.2014 CWa chg: default indent to 4 * [02] 10.05.2014 CWa cor: header text * */ #include <iostream> #include <stdlib.h>
The name command can resolve files with the same suffixes as the revision command plus .exe and .dll files.
See revision for a list of predefined file suffixes that are computed.
To add more suffixes to be resolved, set the SUFFIXES=.suff_1;.suff_2;.suff_n setting in the etc/name.cfg file.
The function short description header must have one of the following formats to be processed:
# function -- description text
' function -- description text
// function -- description text
-- function -- description text
rem function -- description text
Example Windows™ batch file:
rem filesize "path" -- set !size! to file size rem :filesize set size=%~z1 exit /b 0 goto:eof
Example AWK program file:
# timeout(seconds) -- sleep for seconds # function timeout(seconds){ exec("sleep " seconds) } # timeout
Example C++ program file:
// year() -- return current year as string // string year(){ time_t epoch = time(NULL); struct tm * t = localtime (&epoch); return to_string(t->tm_year+1900); } // year
See also: llcomp and lscomp to list contents of a *.zip file without decompression.
See also: llcomp and lscomp to list contents of a *.zip file without decompression.
Create an ordered list of all MP3 files in a directory and send the output to the clipboard (e.g. to paste the list into a document):
[ h:\data\example\myMusic ] [ fred@ACME001 ][*wtshell*/cmd]: dir /o /b *.mp3 | gclip
Create the same list of music files without the .mp3 suffix (=substitute the last 5(!) characters with nothing):
[ h:\data\example\myMusic ] [ fred@ACME001 ][*wtshell*/cmd]: dir /o /b *.mp3 | sed "s/.\{5\}$//" | gclip
or
[ h:\data\example\myMusic ] [ fred@ACME001 ][*wtshell*/cmd]: dir /o /b *.mp3 | sed "s/.....$//" | gclip
Save a list selected and copied to the clipboard using Control+C from Excel™ to a file to be used for additional processing:
-> open an Excel Workbook in Excel -> select related data in the Worksheet -> press Control+C [ h:\data\example\lists ] [ fred@ACME001 ][*wtshell*/cmd]: pclip > example.txt
See the example for the section command below.
Example:
rem rem WA2LWinTools\etc\wtshell.cfg - config for wtshell rem rem [00] 06.12.2016 CWa Initial Version rem echo initialize ... rem set HTTP(S)_PROXY rem section ON PROXY && goto PROXY call proxy >nul 2>&1 :PROXY rem JDK settings rem section OFF JDK && goto JDK set JAVA_HOME=%~d0\bin\JDKPortable set PATH=%PATH%;%JAVA_HOME%\bin :JDK rem add additional aliases rem section ON ALIASES && goto ALIASES doskey cdprog=godir "%~d0\dat\prog" setusage "cdprog" "cd %~d0/dat/prog/" doskey cdws=godir "%USERPROFILE%\Documents\var\Workspace" setusage "cdws" "cd MyDocuments/var/Workspace/" :ALIASES echo. && echo done.
This example will execute call proxy and set the additional aliases (=doskey macros) but will skip the setting of the JAVA_HOME and PATH variables needed by the Java Development Kit (JDK).
When the environment variable WA2L_SECTION_PRINT is not set to False (in the configuration file etc/wtshell.cfg) it is printed if a section is activated as follows:
[ON ] PROXY [OFF] JDK [ON ] ALIASES
To print the activated ([ON ]) sections only, set WA2L_SECTION_PRINT to ON and to print the deactivated ([OFF]) sections only, set it to OFF.
If the -z timezone option or the TZ=timezone environment variable is set, the timestamp of the specified POSIX timezone is used.
Examples:
-z UTC England/London (Greenwich Mean Time) -z UTC+8 USA/Santa Barbara -z UTC+5 Peru/Lima -z UTC-1 Switzerland/Beringen -z UTC-2 Switzerland/Beringen (Daylight Saving Time) -z UTC-10 Australia/Sydney
See also: https://www.timeanddate.com/time/map/ for additional information.
If you want to apply the proxy settings automatically on each wtshell start, add the following entry to the etc/wtshell.cfg configuration file:
call proxy
The exit command is an alias (=doskey macro) to the quit command. Therefore when you enter the exit command interactively you actually start the quit command.
The etc/wtshell.cfg file is a Windows™ BATCH (*.bat) file and has therefore to comply to the conventions of a BATCH file.
If you want to apply the proxy settings automatically on each wtshell start, add the following entry to the etc/wtshell.cfg configuration file:
call proxy
To skip the execution of the etc/wtshell.cfg file press and hold the SHIFT key during startup of wtshell. You will see the message
wtshell-INFO: fast start without reading wtshell.cfg
during start if you do so.
See also section command in SPECIAL PURPOSE COMMANDS to conveniently enable/disable a group (=section) of settings in the wtshell.cfg file.
This directory is automatically added to the %PATH% variable and therefore the scripts added to that directory are available when using wtshell.
This directory is not changed when installing/upgrading the WA2L/WinTools package with the exception of the provided example scripts (gpx2kml and gpx2csv).
When adding scripts to the var/scripts/ directory you also might consider to add a short usage line (see: usage command above) to the script. Doing this your script also appears in the output of the usage [ selection ] command.
The entry is identical to the ones added to scripts. See output of usage -h or usage -t to see usage entry templates/examples.
This command is useful when connecting to the system thru the OpenSSH Server on a Windows™ system and quickly starting the enhanced shell wtshell without the need to change to the installation directory of the WA2L/WinTools package; you can then simply call wtshell.
This file is added/removed when selecting the related option in the config command or using the lib/config.SHELL [ -i | -u ] command.
This is free software; see WA2LWinTools/man/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.