This project adheres to Semantic Versioning.
- New function
lb_say
to say something with text-to-speech - New
--say
option tolb_display
andlb_result
lbg_notify
is now supported on Windows using PowerShell- Filters in
lbg_choose_file
are now supported on macOS
- Minor code improvements
- New
--template
option tolb_import_config
to import variables only defined in a template file
lb_test_arguments
is deprecated, but not removed to not break compatibility
- Fix bug that prevented email to be sent if old mail command was installed
- New function
lb_ami_root
to test if current user is root
- Improve
lb_current_uid
- Improve performance by removing internal functions calls
- Improves functions independence if you want to copy/paste one of them in a script without loading libbash.sh
- Fix bug that could run false commands on Windows
- Secure
lb_import_config
with escape of<
and>
characters
- New function
lb_cmd_to_array
to store results of a command in an array. - New function
lb_current_uid
(and$lb_current_uid
variable) to get the current user uid - New constant variable
$lb_current_uid
lb_in_group
default user is get bywhoami
command
- Fix bug that prevented
lb_set_config
to work properly on BSD/macOS
lbg_choose_file
is now supported on Windows using PowerShell- Multiple choices for
lbg_choose_option
is now supported on macOS lb_get_config
can now read configs from stdinmail
command is now supported forlb_email
- Removed unused variable
$lbg_path
- Renamed translations variables (BE CAREFUL TO UPDATE YOUR OWN TRANSLATIONS, IF ANY)
lbg_choose_option
now supports multiple choices with-m
option- New function
lb_group_exists
to test if a group exists (does not work on Windows and macOS) - New option
--display-level
inlb_result
andlb_short_result
- In
lb_result
andlb_short_result
, option--log-level
does not affect display level (set in new option--display-level
)
- Fixed bug and enhance reliability of
lb_generate_password
- Enhance reliability of df functions
- Fixed bug when inserting a value in empty file in
lb_set_config
- Improve documentation about libbash options calls
- New option
--no-spaces
inlb_set_logfile
to set values likeparam=value
lb_get_config
gets the last value of the file/section if multiple values foundlb_set_config
sets the last value of the file/section if multiple values found- Minor improvements in
lb_is_comment
- Fixed bug in section detection in
lb_set_config
lb_set_logfile
creates log file if it does not exists
- Add usage error detection for
lb_edit
- New option in
lb_set_logfile
to write logs in Windows format - New option in
lb_abspath
to not test absolute paths
lb_get_config
andlb_set_config
sets quotes automatically- Minor code optimizations
- Avoid reading Windows endline characters in config values
- Insert new config lines failed on macOS/*BSD
- Fix spaces detection in grep regex for macOS/*BSD compatibility
- Add stdin support for some functions:
lb_print
lb_error
lb_display
andlb_display_*
lb_log
lb_trim
lb_is_comment
lb_email
lbg_display_*
lbg_notify
- New analyse mode for
lb_read_config
lb_getargs
andlb_getopt
now supports options with syntax--option=value
- New filters argument in
lb_import_config
to import only some variables - New function:
lb_migrate_config
to migrate config files
- Internal variables and functions are renamed with custom prefix
- Code cleaning
- Append an empty line above a new section in
lb_set_config
- Minor improvements for variables
- Update documentation for BSD support
- Add support for BSD systems
- New function:
lb_istrue
to test boolean values - Fixed a bug in
lbg_open_directory
for Windows - Many code optimizations
- Improve documentation
- New functions:
lb_getargs
andlb_getopt
to improve arguments parsing in scripts - New quiet mode to disable displays (+ editable variable
$lb_quietmode
) - Improve documentation and examples
- Detect
sed
version to makelb_edit()
work on any system - Some context variables are now read-only
- Use
lb_edit()
inlb_set_config()
to avoid create backup files
- New function:
lb_edit()
to edit a file properly with thesed -i
command
lb_array_contains()
renamed tolb_in_array()
(old name kept for compatibility)lb_dir_is_empty()
renamed tolb_is_dir_empty()
(old name kept for compatibility)- Improve error management to avoid crashes when using command
set -e
- Code quality improved by ShellCheck
- Various performance improvements
- New function:
lb_split()
to split a string into array - New function:
lb_join()
to join array into string
lb_command_exists()
now returns only error code 1 and accepts multiple argumentslb_function_exists()
accepts multiple argumentslb_user_exists()
now returns only error code 1 and accepts multiple arguments- More strict results in
lb_is_number()
,lb_is_integer()
andlb_is_boolean()
: all arguments are verified lb_array_contains()
now returns 2 if no array is provided- Major code refactoring to improve local variables use and readability
- Improve loading and add new return codes for libbash loading status
- Fix bad values in
$lb_current_script
$lb_current_script_name
and$lb_current_script_directory
(bug exists since v1.6.0) - Fix section bugs in
lb_read_config()
andlb_import_config()
when reading files with Windows end of line format
- New function:
lb_get_config()
to get a single value from a config file - New option to send emails in HTML format in
lb_email()
function - New option to add files attachments in emails in
lb_email()
function - Speed optimizations
- Minor bugfixes
- Various improvements in documentation
- Add new
$lb_current_hostname
variable
- [Windows] Fixed a bug for
lb_set_logfile()
andlb_get_logfile()
which failed if logfile was in a samba share
- New aliases for display functions:
lb_warning()
->lb_display_warning()
lb_info()
->lb_display_info()
lb_debug()
->lb_display_debug()
- New aliases for dialogs functions:
lbg_critical()
->lbg_display_critical()
lbg_error()
->lbg_display_error()
lbg_warning()
->lbg_display_warning()
lbg_info()
->lbg_display_info()
lbg_debug()
->lbg_display_debug()
- New function:
lb_date2timestamp()
to convert a date to a timestamp - New function:
lb_timestamp2date()
to convert a timestamp to a date - New debian package available to deploy libbash files in
/usr/lib/libbash
- Minor improvements in code and documentation
- New function:
lb_group_members()
to get users members of a group (works only on Linux systems) - New function:
lb_set_config()
for setting values - Support for config INI files for
lb_read_config()
andlb_import_config()
: ';' lines are comments, sections supported - New options for
lb_read_config()
andlb_import_config()
to filter by config sections - Removed multiple files support for
lb_import_config()
- Improvements in documentation
- Improved speed of config reading in
lb_read_config()
andlb_import_config()
- Improvements in documentation
- New function:
lb_read_config()
to read a config file (likelb_import_config()
without assigning to variables) - Fixed a bug in
lb_import_config()
for values containing the=
character - Huge performance improvements in
lb_import_config()
- Add support in
lb_df_fstype()
for Linux systems withoutlsblk
command
- Various performance improvements
- Changed results of
lb_df_space_left()
in KB instead of bytes to avoid differences between Linux and macOS - Add test and error code for files not readable in
lb_import_config()
- New function:
lb_import_config()
to read a file and import values into variables - New function:
lbg_open_directory()
to open a GUI file browser - New
--multiple
option inlb_choose_option()
to let user choose multiple options - Changed arguments for
lb_input_password()
andlbg_input_password()
(this does not break backward compatibility) - Minor code improvements
- Removed \n printed on Windows dialogs
- Fixed a very specific case for cscript on Windows that cannot run vbscripts from an absolute path
- Added Windows GUI support for
lbg_input_text()
,lbg_choose_option()
andlbg_choose_directory()
- Improve results of
lb_df_fstype()
andlb_df_uuid()
usinglsblk
command on Linux (see documentation) lbg_input_text()
now supports backslashes entries without putting doubles- Various improvements in source code and documentation
- Fixed a bug in
lb_compare_versions()
that caused bad results when comparing 0.x versions
- Major bugfix in arguments loading that caused bugs for
getopts
command in user scripts
- Add support for Windows systems powered by Cygwin!
- New variable and options to run a command when
lb_exit()
is called (see documentation) - New functions:
lb_user_exists()
andlb_in_group()
- New function:
lb_is_email()
to test if a string is a valid email - New display level support with functions:
lb_get_display_level()
andlb_set_display_level()
(since now, the display level was the same as the log level) - New variables:
$lb_current_user
(current user name),$lb_path
(libbash.sh path),$lbg_path
(libbash.sh GUI path) and$lb_directory
(libbash.sh directory) - New option in
lb_input_password()
andlbg_input_password()
to check minimum size of a password - New options to load libbash GUI and locales
- Automatic loading of locales for user language
- Renamed
lb_get_loglevel()
tolb_get_log_level()
andlb_set_loglevel()
tolb_set_log_level()
(+ added aliases to not break compatibility) - Renamed
lb_detect_os()
tolb_current_os()
(+ added alias to not break compatibility) - Many improvements and optimizations in source code
- Improvements in documentation
- New function:
lb_trim()
- Fix missing quotes that could cause bugs in paths with spaces
- New functions:
lb_is_boolean()
,lb_compare_versions()
andlb_generate_password()
- Minor code improvements
- New
$lb_current_os
variable with current OS lbg_set_gui()
with no argument now sets the default GUI tool (useful when reseting)- Delete
lb_log()
write error messages
- Fix bug on zenity notifications that hung scripts (removed the
--listen
option)
- Bugfixes and improvements on
lb_result()
,lb_short_result()
andlb_exit()
- New
--error-exitcode
option forlb_result()
andlb_short_result()
to set a custom exit code if error - WARNING: the former
-e
option alias used for--save-exitcode
is renamed to-s
inlb_result()
andlb_short_result()
- Documentation: add script examples and demo
- New function:
lb_abspath()
- New function:
lb_is_comment()
- Console size detection and improvements for the dialog command
- Add
--absolute-path
options tolbg_choose_file()
andlbg_choose_directory()
- Change behaviour for
lb_result()
on exit to return$lb_exitcode
variable and not command result - Renamed option
--save-exit-code
to--save-exitcode
forlb_result()
andlb_short_result()
- Set explicit returns to functions to avoid confusion and maybe errors
- New function:
lb_is_number()
- Add macOS support for
lb_df_fstype()
- Add macOS support for
lb_df_uuid()
- Better implementation of
lb_short_result()
: exit code argument is now an option
- Fix bug in
lb_exit()
: bad variable name
- Add a missing French translation
- First release on Github
libbash.sh is licensed under the MIT License. See LICENSE.md for the full license text.
Author: Jean Prunneaux https://jean.prunneaux.com