WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: command-line tools that can be easily approximated using (interprted) scripts  (Read 872 times)

Offline mocore

  • Hero Member
  • *****
  • Posts: 612
  • ~.~

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

Offline mocore

  • Hero Member
  • *****
  • Posts: 612
  • ~.~
 ;D
shit == Shell Git
https://git.sr.ht/~sircmpwn/shit -  an implementation of Git using (almost) entirely POSIX shell.


Offline gadget42

  • Hero Member
  • *****
  • Posts: 719
;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/
The fluctuation theorem has long been known for a sudden switch of the Hamiltonian of a classical system Z54 . For a quantum system with a Hamiltonian changing from... https://forum.tinycorelinux.net/index.php/topic,25972.msg166580.html#msg166580

Offline mocore

  • Hero Member
  • *****
  • Posts: 612
  • ~.~
dos2unix unix2dos Re: cli tools approximated via (interprted) scripts
« Reply #3 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
« Last Edit: August 22, 2024, 07:21:58 AM by mocore »

Offline mocore

  • Hero Member
  • *****
  • Posts: 612
  • ~.~

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.

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