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-casestotest🆙
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/--versionoptions 🚩
🍬 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
timestampvar to avoid inconsistency ⌚️
- unify error message format and refactor related functions ℹ️
- keep
usagefunction simple - use
-s/-hoption for optional argument ofdiefunction
- keep
- use
${var##*/}instead ofbasenameto assignPROGvar 🎛️- faster, no subprocess fork
- use command
realpathinstead of functionportableReadLink🔗- faster and without losing portability
- use bash builtin
type -Pinstead ofwhichcommand, 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 Arithmeticcomparison instead ofConditional Expressions🔢 - use
=instead of==inConditional Expressions - use
||/&&instead of one branch/one lineif🎰 - inline
colorPrintfunction if only one caller - variable related refactors:
- extract
UNAMEvar 🔠 - rename var, use
COLOR_INDEXinstead ofCOUNT - remove
declarekeyword 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
1in 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
shellcheckitem doc link instead of prolixity comments ✨
🚜 Build/CI
- upgrade GitHub actions; add
dependabot.yml🤖 - upgrade
shunit2lib
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/envin shebang (by @hyperupcall in #119) 🐚 coat/taoc: 🐈- remove pipe when naked
cat(more straightforward and faster) 😸 - extract
colorLinesfunction 🌈
- remove pipe when naked
a2l: merge functioncolorPrintintorotateColorPrint🛠️- improve readability
- remove var interpolation in
printf formatif possible - rename vars, e.g.
message->content,normal->color_reset👓 - use
\einstead of\033 - improve comments for
-tcheck
- 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
shunit2lib
Have Fun! 💕
2024-01-25
🐌 v2.5.1 🐞🚞🕵️
🐞 BugFix
c: wrong exit code with-qoption 🐞
🛠️ 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_SOURCEarray to detect whether this script is sourced or not 🕵️ - use
printf💪 instead ofecho - use
ifinstead 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
teeAndCopyfunction - use boolean option parse value holder
- reanme vars
- simplify
- improve shell robustness/portability 💪
- use
printfinstead ofecho - use
if-elseinstead 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
shellcheckissues
📚 Documentation
- update logo and image links in docs 🌁
- disable default link of github images
🚜 Build/CI
- update
ci.yaml, test on latestMacOS🍎 - upgrade
shunit2lib
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
readonlyif 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
CPUpercentage order underpsfromprocps-ng 3.3.12🍢 - use one option
--cpu-sample-intervalinstead 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
jstackcommand search order,JAVA_HOMEbeforePATH
- 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
