A powerful alternative to the standard system ‘shell’, the Hubbard Software CLI is positioned between limited shells and scripting languages. It contains a robust set of native functions,
can be run interactively like a shell or using command ‘macros’ (batch script files). Plus, it is portable across Operating Systems, as it is written entirely in Java®.
Available in several packages from a free version up to an Enterprise version which allows full user customization. In the upper versions, you can even add your own commands and localize all the text and formatting for your own requirements. If you don’t like our command names, just rename them!
Powerful Features:
Robust command set – No need for many external tools.
Macros – Write your own scripts.
Named Variables – String, Integer, and Floating Point. Use the default or name as many as you need!
Full User Environment Stack – Variables, Working Directory, Prompt, Output File, and many other settings live on a stack you can push and pop from.
Minimal Uniqueness on all Commands and Switches – Tired of typing?
Pseudomacros – Large set of ‘functions’ that can be used anywhere in a command, and nested. Includes If/Then/Else control flow structures, math, string manipulation, and many others.
Structured Error Handling – Need to ignore an error on occasion? Or even treat a warning more seriously? No problem. Available per command or for whole session.
Output Redirection – Available for whole session, or just per command.
Full Localization and Customization available. Define your own date/time formats, language, message text, even command and switch names!
Can Your Shell Do This?
Use named variables and conditional expansion.
) string/name=str1 AAA
) string/name=str2 BBB
) write String 1 and String 2 are [!equal [!string/name=str1] [!string/name=str2]]Equal[!else]Not Equal[!end]
String 1 and String 2 are Not Equal
Note the use of the [!equal], [!else], [!end], and [!string] 'pseudomacros' that allow inline processing within a command string, nested as needed.
Repeat a command or macro for multiple arguments by putting the args in parens.
Here, a batch script (macro) named invoice_run.cli is being run twice, once with each file as an argument.
And here the above example of an invoice run is used combining the parens and the angle brackets.
) invoice_run.cli (<jan feb>_invoice.dat)
Run a backup, logging the details to a file.
) push
) cd c:\users\martin\Documents
) listfile backup_[!date/format=yyyyMMdd]_[!time/format=HHmmss].log
) move/copy/recent/v/exclude=Dev "F:\\Laptop Docs" #
) pop
We pushed a level of the environment, changed directory, set the output (listfile) to a log file with date/time stamp, then moved any files that changed, where '#' means the current directory and everything under it, and we exclude the Dev directory. Then popped the environment, restoring us to the previous level working directory, and also restoring the previous listfile (possibly your console).
Note the use of the [!date] and [!time] 'pseudomacros'.
Or now the same thing using minimal uniqueness:
) pu
) cd c:\users\martin\Documents
) li backup_[!da/f=yyyyMMdd]_[!ti/f=HHmmss].log
) mo/c/r/v/ex=Dev "F:\\Laptop Docs" #
) po
List files, sorting first by type, and then by time-last-modified from oldest to newest.
) filestatus/sort=type+tlm
Now, with minimal uniqueness, reversing the sort order of the 'tlm', and choosing specific fields to display via the /fields= switch (/fi= for short). Here we just display the name and time last modified from newest to oldest. Fields can be in any order.
) fi/so=ty+-tlm/fi=na+tlm
Show all files bigger than a megabyte in, and under, your current directory, showing the file's directory. Sorted by size.
) fi/so=siz/fi=dir+na+tlm/sizegt=1000000 #
Filter switches available for size and times (created, modified, accessed). Test for =, !=, >, <, >=, <=
Where is that file? Find it on your 'Searchlist' (similar to a 'path')
How about expanding the contents of a file, and extracting data from the first line?
) string [batchrun.out]
) write Batch run was of type: [!string/start=1/end=4]
Batch run was of type: INV1
) rename batchrun.out batchrun_[!string/start=1/end=4].out
Here, the file named 'batchrun.out' had a first line of 'INV1 0000 23.4' and we put it in a string variable (un-named) by using the file expansion notation of square brackets, and then used the first 4 characters of it to display the type of the run, and renamed it also.