A Better Tool:

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:

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.

) invoice_run.cli (jan_invoice.dat feb_invoice.dat)

Run multiple commands on the same arguments.

) (filestatus type) invoice.dat

Or using minimal uniqueness:

) (fi ty) invoice.dat

Use shortcuts to make multiple arguments from concatenated strings by putting text in angle brackets.

) write Test.<dat txt>
Test.dat Test.txt
) write Test<1 2>.<dat txt>
Test1.dat Test1.txt Test2.dat Test2.txt

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')

) searchlist C:\utils,c:\Dev,c:\users\myid\documents
) path backup_dev.cli

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.