Skip to content

Releases: BetterScripts/shtoolkit

v26.1

Choose a tag to compare

@BetterScripts BetterScripts released this 10 Jul 14:50

Major Update

BREAKING CHANGES! (See below.)

More complete list of changes available in CHANGES.MD.

NEW

  • Name: BetterScripts shtoolkit.
  • Libraries:
    • libmap.sh - emulated associative arrays for any shell.
    • libpath.sh - commands to assist with path processing, including path information like size, owner, etc and a portable mktemp alternative.
    • libstring.sh - commands assist with string processing.
  • Simple debugging support across all libraries.

CHANGES & FIXES

  • BREAKING CHANGE Significantly reworked libarray.sh which is now more robust, and more consistent.
  • General improvements across all libraries.
  • Test harness updates and changes for correctness, robustness, and portability.

LIBARRAY

Changes required result in differences verses previous library versions - some previously supported usage is no longer works:

  • Pattern matching has been completely rewritten - it is now more portable, robust, and the same options are available everywhere. Some previously working matches will no longer match. Affects array_remove, array_search, array_contains, andarray_split.
  • Command options now MUST precede any non-option arguments. Affects array_from_path.
  • array_printf no longer writes anything for empty arrays (previously a single <newline> would be written).

v2024-08-14 Latest

Choose a tag to compare

@BetterScripts BetterScripts released this 14 Aug 14:44

Release v2024-08-14 for 14th August 2024, includes:

libarray.sh - v1.2.0
libdeque.sh - v1.1.0
libgetargs.sh & getarg - v1.3.0

Release is focused on portablity updates and makes many changes across all libraries and many tests.

libarray.sh v1.2.0

  • [NEW] Added array_is_array.
  • [NEW] array_split now has multiple ways of splitting text.
  • [FIX] (PORTABILITY) Added trailing '\n' to printf - without it some implementations will effectively discard the last line of data.
  • [FIX] (PORTABILITY) Rewrote awk scripts to better match platform capabilities. (All awk usage has changed considerably.)
  • [FIX] (PORTABILITY) Added workarounds for sed where '\n' in a replacement expression does not result in a <newline>.
  • [FIX] (PORTABILITY) Changed sed scripts to avoid long label names and remove grouping with { when not required.
  • [FIX] (PORTABILITY) Minor changes to some case statements which should now be more portable, though never showed any issues (e.g. add ;; to some statements where it was missing even though this was permitted.)
  • [FIX] (PORTABILITY) Use null string instead of no arguments for echo when intent is only to output a <newline>.
  • [FIX] (PORTABILITY) Minor changes to parameter expansion to avoid issues with ksh88.

libgetargs.sh & getarg v1.3.0

  • [FIX] Fixed an issue that would cause a failure under set -u when an unset user variable was used. (Although the failure may be useful, it breaks the principle that behavior is the same under set -u and set +u.)
  • [FIX] (PORTABILITY) Added trailing '\n' to printf - without it some implementations will effectively discard the last line of data.
  • [FIX] (PORTABILITY) Rewrote OPTION matching to be simpler and more portable: sed is now used in place of expr and grep for all matching; tr is required where previously use was based on config. (NOTES: Previously rejected OPTION-CONFIG may now be accepted; performance characteristics may have changed, however overall performance was not measurably altered.)
  • [FIX] (PORTABILITY) Minor changes to some case statements which should now be more portable, though never showed any issues (e.g. add ;; to some statements where it was missing even though this was permitted.)

libdeque.sh v1.1.0

  • [FIX] (PORTABILITY) Added workarounds for grep where '-F' is not available. (Assumes fgrep is available in this case - this may change.)
  • [FIX] (PORTABILITY) Removed - when used to indicate input is from STDIN.
  • [FIX] (PORTABILITY) Minor changes to parameter expansion to avoid issues with ksh88 and posh.

Other

  • [FIX] Makefile doc generation (typo caused incorrect behavior outside GNU tools).
  • [FIX] (PORTABILITY) Fixes to test harness and tests for portablity.
  • [NEW] Added support for more auto-detected shells in test harness.
  • [CHANGE] Documentation updates & edits.

Full Changelog: v2024-06-29...v2024-08-14

v2024-06-29

Choose a tag to compare

@BetterScripts BetterScripts released this 29 Jun 15:13

Release v2024-06-29 for 29th June 2024, includes:

  • libarray.sh - v1.0.1
  • libdeque.sh - v1.0.0
  • libgetargs.sh & getarg - v1.2.0