Merge request seeks review
https://gitlab.freedesktop.org/xdg/xdg-utils/-/merge_requests/153
Merge request seeks review
https://gitlab.freedesktop.org/xdg/xdg-utils/-/merge_requests/153
Happy to announce that I just published my #PolyglotScript v2.0.0 research report for #cli #commandline #shell. It consolidates #batchfile, #PowerShell, and #POSIXShell together into 1 single file that can run anywhere, everywhere without requiring to install anything.
Tested on #linux, #windows, and #macos. For #FreeBSD, still pending because GitHub does not officially facilitate #FreeBSD yet.
Check it out at:
Conventional scripting practices remain tethered to platform-specific interpreters, forcing developers to maintain redundant codebases like batch, PowerShell, and POSIX shell. This poses a significant problem when there is a requirement to unify all of them under a single common command especially seen in continuous integration (CI) implementations. Moreover, the situation worsens considerably for cross-platform implementations where the initializer must locate not only the correct interpreter but also OS-specific and architecture-specific executables before running them. Unlike programming languages, there are requirements where these scripts run first to initialize the environment, such as setting up a programming language interpreter. Therefore, there is a need for these initializer unifications. This research project introduces the Polyglot Scripts, a novel unification layer that enables a single unified script file to execute seamlessly across Windows OS, UNIX, and UNIX-like OSes without modification. It is done by exploiting the syntactic intersections and conditional parser directives among the shell scripts, achieving true write-once-run-anywhere semantics at the shell level. Beyond cross-platform utility, these scripts simplify the user command into a single launch file, permit on-site editing instead of compiling|cross-compiling every time, and remain adaptive across all operating systems' technological advancements. For automation engineers/developers, this project produces a set of usable Polyglot Scripts to quickly eliminate environment anxiety, shrink maintenance overhead, and deliver future-proof workflow portability without increasing the learning curve. Polyglot Scripts: a universal runtime contract between the human and any machine in the past, present, and future. This is a self-sufficient independent research report. Therefore, you MUST ALWAYS approach it with full skepticism before reading. Let the report's data and presentation convince you. Verify the findings by reproduction and check its reference validity before concluding your judgment.
#Poll: Curious about people's attitudes towards shell scripting.
Two part question:
#Unix #UnixShell #ShellScript #ShellScripting #POSIX #PosixShell #sh #bash #zsh #csh #tcsh #ksh #pdksh #oksh #mksh
Should've made this a long time ago:
function ciglob {
#case-insensitive glob generator
echo "$*" |while read -N1 c; do
case "$c" in
[a-zA-Z]) echo -n "[${c^^}${c,,}]";;
*) echo -n "$c"
esac
done
}
~ $ ciglob "Hello, world!"
[Hh][Ee][Ll][Ll][Oo], [Ww][Oo][Rr][Ll][Dd]!
~ $ ls -ld $(ciglob documents)
drwxr-xr-x 52 ~~~ ~~~ 20,480 Apr 10 11:45 Documents
(Not the most useful example, but I did have a use case in mind when I wrote it ;)
P.S. (This is a valid way to close a parenthesis. Fight me ;)
#bash #ksh #sh #shell #UnixShell #POSIX #PosixShell #ShellScripting
hardware-independent openWRT-extension (using POSIX-shell as main-language) for setting up, monitor and manage many, large wifi-mesh-networks for different locations including billing, captive port...
foo $(bar) $(baz 1)
"They made me stop using the backtick because on non-U.S.A. keyboards it is often a dead key. So I picked the U.S.A. dollar as its more international replacement."
(-: