00:00
00:00
xeiavica
Matthew Polk @xeiavica

Age 31

Joined on 12/26/23

Level:
5
Exp Points:
212 / 280
Exp Rank:
> 100,000
Vote Power:
4.24 votes
Rank:
Civilian
Global Rank:
> 100,000
Blams:
0
Saves:
4
B/P Bonus:
0%
Whistle:
Normal
Medals:
1
Supporter:
1y 6d

I really like shell scripting

Posted by xeiavica - 3 weeks ago


iu_1323924_20436071.jpg


One of my favorite things is toying with technology, most commonly taping together shell scripts to do what I wish for it to do. My favorite would have to be a lesser known one called ksh93. It's better than bash, it like zsh has floating points and it has what no other shell has is compound variable. It's very similar in execution to C structs or pascal records where you can group a string or variable or even a function to a single name and use "." notation to avoid a million different names.

Here's an example from a really old unix related website that still works in the community fork of ksh93:


$ typeset -C var=(elone=10 eltwo=20 eltree="Billy Bob")

$ print -r "$var"
(
    elone=10
    eltwo=20
    eltree="Billy Bob"
)

$ print "${var.elone}"
10

Note that this won't work in bash, it doesn't even have floating points in it. But ksh93 is very cool, it's not as complex as awk or perl or python, but I find it to be really cool. Every unix system needs a shell of some kind, be it fish or zsh or even bash. So it's not dependency demanding like say setting up perl or python or ruby. Either way, it's pretty cool.


4

Comments

Comments ain't a thing here.