Tiny Core Linux

Off-Topic => Off-Topic - Tiny Core Lounge => Topic started by: mocore on November 30, 2023, 12:07:42 AM

Title: command-line tools that can be easily approximated using (interprted) scripts
Post by: mocore on November 30, 2023, 12:07:42 AM

i was reminded of the below quote

Heh, if you want head or tail, use sed commands to do it and perhaps alias it by those names, or make it an executable script.  Remove those from busybox and relive the true spirit of the day!

while reading

>standard command-line tools that can be easily approximated using short Haskell expressions.
https://github.com/gelisam/hawk # Haskell text processor for the command-line

Quote
While Hawk and awk have similar use cases, the philosophy behind the two is very different. Awk uses a specialized language designed to concisely express many text transformations, while Hawk uses the general-purpose language Haskell, which is also known for being concise, among other things. There are many standard command-line tools that can be easily approximated using short Haskell expressions.

and have afair.. also seen examples in the gawk manual of mimicking (*tangent ~ https://en.wikipedia.org/wiki/To_Mock_a_Mockingbird) ..
eg https://www.gnu.org/software/gawk/manual/gawk.html#wc-program

and wander if anyone knows of any similar scripted alternatives "standard command-line tools"

...
hi *

heare are afew  oddities awk found while looking for other compleatly diffrent awk related things

https://github.com/djanderson/aho -  A git implementation in awk


https://github.com/huijunchen9260/fm.awk - File manager written in awk
Title: Re: command-line tools that can be easily approximated using (interprted) scripts
Post by: mocore on November 30, 2023, 01:33:29 AM
 ;D
shit == Shell Git
https://git.sr.ht/~sircmpwn/shit -  an implementation of Git using (almost) entirely POSIX shell.

Title: Re: command-line tools that can be easily approximated using (interprted) scripts
Post by: gadget42 on November 30, 2023, 06:20:37 AM
;D
shit == Shell Git
https://git.sr.ht/~sircmpwn/shit -  an implementation of Git using (almost) entirely POSIX shell.

more drew devault can be enjoyed at:
https://drewdevault.com/
Title: dos2unix unix2dos Re: cli tools approximated via (interprted) scripts
Post by: mocore on August 22, 2024, 07:13:00 AM

if you want head or tail,
use sed commands to do it and
perhaps alias it by those names,
or make it an executable script. 
Remove those from busybox and
relive the true spirit of the day!

 https://wiki.gentoo.org/wiki/Dos2unix
 https://waterlan.home.xs4all.nl/dos2unix/NEWS.txt
 https://sourceforge.net/p/dos2unix/dos2unix/ci/master/tree/dos2unix/

Code: [Select]
# unix2dos.awk
# https://bbs.archlinux.org/viewtopic.php?pid=558805#p558805 # unix2dos
# https://github.com/ajdan4q/awk/blob/master/dos2unix.awk

{sub(/$/,"\r")};1



Code: [Select]
# dos2unix.awk
# https://bbs.archlinux.org/viewtopic.php?pid=558805#p558805 # unix2dos
# https://github.com/ajdan4q/awk/blob/master/dos2unix.awk

{sub(/\r$/,"")};1



 idk how useful/relevant (or even functional (ymmv as they say)) these might be
 they are interesting though imho
Title: Re: command-line tools that can be easily approximated using (interprted) scripts
Post by: mocore on August 22, 2024, 09:14:48 PM

https://github.com/HeinrichHartmann/luawk  -  A lua based AWK

https://github.com/stevedonovan/lua-command-tools -  Command-line utilties for performing common Lua one-liners, like matching string patterns and substitution.

Quote
llua is a small Swiss Army-style command utility which exposes the expressive power of Lua to command-line scripters.
 In particular, making it easier to use a programming language for one-liners should not reinvent awk
...
I did not resist the temptation to reinvent awk, since the functionality was so convenient.

Lua patterns are also used for URL rewriting in OpenBSD's httpd daemon.

Quote from: https://man.openbsd.org/patterns.7
HISTORY

The first implementation of the pattern rules were introduced with Lua 2.5. Almost twenty years later, an implementation based on Lua 5.3.1 appeared in OpenBSD 5.8