Releases: oldratlee/useful-scripts
Releases · oldratlee/useful-scripts
🐌 v3.0.0-Alpha: a WIP/cleanup release
Note
This is a WIP/cleanup release for upgrading version to 3.x
- remove
legacy bin
🚮 - rename dir
test-cases
totest
🆙
It's time to say goodbye, my friend
It's been a long day without you my friend
And I'll tell you all about it when I see you again
We've come a long way from where we began
Oh I'll tell you all about it when I see you again
Have Fun! 💕
2024-04-15
🐌 v2.5.4 🍬🎰
☘️ Features
- [
c
]: ensure using command onPATH
, and check the command existence onPATH
👣 - [
coat/taoc
]: add--help/--version
options 🚩
🍬 Improvements
- [
find-in-jars
]: addIFS=
forread
, more robust 💪- file paths may contain leading spaces
- [
show-busy-java-threads
]:- improve separator blank line output 💅 fix wrong blank line logic
- extract
timestamp
var to avoid inconsistency ⌚️
- unify error message format and refactor related functions ℹ️
- keep
usage
function simple - use
-s
/-h
option for optional argument ofdie
function
- keep
- use
${var##*/}
instead ofbasename
to assignPROG
var 🎛️- faster, no subprocess fork
- use command
realpath
instead of functionportableReadLink
🔗- faster and without losing portability
- use bash builtin
type -P
instead ofwhich
command, faster 🐚
🛠️ Refactor
- [
show-busy-java-threads
]: rename global varUSER
->WHOAMI
👤 - [
uq
]: use exponential operation instead of multiplication to calculate size 🧮 - [
c
]: rename functions 🔡 - use
Shell Arithmetic
comparison instead ofConditional Expressions
🔢 - use
=
instead of==
inConditional Expressions
- use
||/&&
instead of one branch/one lineif
🎰 - inline
colorPrint
function if only one caller - variable related refactors:
- extract
UNAME
var 🔠 - rename var, use
COLOR_INDEX
instead ofCOUNT
- remove
declare
keyword for global vars, more consistent - use upper-case var name for global readonly vars
- unset temp global vars after use
- remove unnecessary
{}
when use var - remove
local nl=$'\n'
declaration if only one usage
- extract
- small code cleanup
- remove unnecessary file descriptor number
1
in redirections ➡️ - remove section comments for simple section
- improve/fix/add code comments
- remove unnecessary file descriptor number
📚 Documentation
- update manual pages links to manned.org 📚
- use
shellcheck
item doc link instead of prolixity comments ✨
🚜 Build/CI
- upgrade GitHub actions; add
dependabot.yml
🤖 - upgrade
shunit2
lib
Have Fun! 💕
2024-04-12
🐌 v2.5.3 ☕️
🐌 v2.5.2 🌗🐚🐈
🐞 BugFix
coat/taoc
: missing last line if there’s no newline at the end of the file 🌗 🙀xpl
: wrong exit code when file not existed or open file failure 🔢
🛠️ Improvements/Refactor
- find bash with
/usr/bin/env
in shebang (by @hyperupcall in #119) 🐚 coat/taoc
: 🐈- remove pipe when naked
cat
(more straightforward and faster) 😸 - extract
colorLines
function 🌈
- remove pipe when naked
a2l
: merge functioncolorPrint
intorotateColorPrint
🛠️- improve readability
- remove var interpolation in
printf format
if possible - rename vars, e.g.
message
->content
,normal
->color_reset
👓 - use
\e
instead of\033
- improve comments for
-t
check
- remove var interpolation in
- simplify var usage
- remove unnecessary
{}
when use var - remove quote of values in simple assignment
- All values undergo tilde expansion, parameter and variable expansion,
command substitution, arithmetic expansion, and quote removal.
Word splitting and filename expansion are not performed. - more info about assignment see
https://www.gnu.org/software/bash/manual/html_node/Shell-Parameters.html
- All values undergo tilde expansion, parameter and variable expansion,
- remove unnecessary
🚜 Build/CI
- upgrade
shunit2
lib
Have Fun! 💕
2024-01-25
🐌 v2.5.1 🐞🚞🕵️
🐞 BugFix
c
: wrong exit code with-q
option 🐞
🛠️ Improvements/Refactor
- use
${array[@]:-}
/${array[@]:+}
to simplify codes 🚞 - use file descriptor number instead of
/dev/std*
(issue #114 summitted by @wushengde) console-text-color-themes.sh
, improve robustness/portability:- use
BASH_SOURCE
array to detect whether this script is sourced or not 🕵️ - use
printf
💪 instead ofecho
- use
if
instead of&&
- remove global var declare if possible
- use
📚 Documentation
- add more resources of
bash
📚
Have Fun! 💕
2023-12-05
🐌 v2.5.0: add `taoc` 🐈 improve shell robustness/portability 💪
☘️ Features
- add
taoc
🫴 🐈 echo-args
: align the index number
🛠️ Improvements/Refactor
c
, improve readable: 👓- simplify
teeAndCopy
function - use boolean option parse value holder
- reanme vars
- simplify
- improve shell robustness/portability 💪
- use
printf
instead ofecho
- use
if-else
instead of&&-||
- involved almost all scripts:
c
/coat
/a2l
/echo-args
/ap
/rp
/xpl
/xpf
/uq
cp-into-docker-run
/tcp-connection-state-counter
/console-text-color-themes.sh
find-in-jars
/show-busy-java-threads
- use
- fix
shellcheck
issues
📚 Documentation
- update logo and image links in docs 🌁
- disable default link of github images
🚜 Build/CI
- update
ci.yaml
, test on latestMacOS
🍎 - upgrade
shunit2
lib
Have Fun! 💕
2023-09-06
v2.4.4 🌈🚞💅
Improvements/Refactor
show-duplicate-java-classes
: print info message and exit when search no jar files or find no class files ℹ️coat/a2l
: skip color for white space lines 🌈- refactor: declare var as
readonly
if possible 📌 - refactor: use
$*
in string instead of$@
🚞
Style
- style: adjust file format 💅
- update
.editorconfig
- shell files
- use 2 spaces indentation
- use
$()
instead of ``
- update
Docs
- add dev guide #64 🎓
- add logo 🎨
- add TOC for README
- improve wording/format
Build/CI
- add github action
ci.yaml
(removetravis
) 👷♀️ - add
MacOS CI
🍎
Have Fun! 💕
2022-12-24
v2.4.3 🍢⏳
Improvements
show-duplicate-java-classes
:- fix wrong
CPU
percentage order underps
fromprocps-ng 3.3.12
🍢 - use one option
--cpu-sample-interval
instead of--top-delay
/--use-ps
⏳
- fix wrong
Cleanup
- code cleanup
- remove unused var
- reorder parameters of function
- improve documentations
- update travis badge to travis.com
Have Fun! 💕
2021-7-21
v2.4.2 🕵️♂️🗂
v2.4.1 🕵️♂️📭🔗
Improvements
show-busy-java-threads
: 🕵️♂️- improve
jstack
command search order,JAVA_HOME
beforePATH
- improve
find-in-jars
:- check list zip entries fail, especially common case "Empty zipfile" 📭
- improve command to list zip entries search 🕵️♂️
- improve scripts
cp-into-docker-run/ap/xpf
: useportableReadLink
🔗
BugFix
xpl
: fix unbound variableargs[@]
♾
Have Fun! 💕
2021-4-30