You are viewing a single thread.
View all comments
6 points

Nice. Just curious about your choice of shell. Why ksh instead of the usual bash, zsh, or fish?

permalink
report
reply
8 points
*

Aside form all the stuff you find in bash, it has some additional unique features mostly related to shell programming. A few example include

  • floating point arithmetic and math functions like sin, cos, exp etc
  • “compound” variables (kinda like an object in javascript)
  • An extended version of getopts which supports both long and short options, and it implicitly creates some additional options for you i.e. a usage page available at --help and a longer manpage style output available at --man
  • In addition to the usual shell builtins, it has a ton of optional ones you can enable at build time, which ranges from basic stuff like chown and chgrp (faster than invoking a new process) to an integrated tcp/udp server with an event loop (i.e. “mkservice” and “eloop” commands)
  • Command line and history editing with vi/emacs commands
  • coprocesses: you can start programs/subshells in the background but still communicate with the std input/output of them while the main script runs either by using the -p flag to read/print or by assigning file descriptors to them (so you support more than one background process this way)

TBH, I don’t even use some of these features, but it’s still a very cool shell, and probably underrated. Not to mention I like being contrarian at times.

Note; AFAIU these advanced features don’t apply to ksh’s clones like mksh or openbsd’s ksh, they are unique to the original “ksh93”.

On the downside, it’s command completion is pretty basic compared to bash. It completes paths and filenames, but you can’t extend it to complete command line arguments to commands or anything

permalink
report
parent
reply
3 points
*

Nice to know. Thanks for the detailed reply.

permalink
report
parent
reply
1 point

is there any different?

permalink
report
parent
reply
1 point

They’re all slightly different.

permalink
report
parent
reply

Unixporn

!unixporn@lemmy.ml

Create post

Unixporn

Submit screenshots of all your *NIX desktops, themes, and nifty configurations, or submit anything else that will make themers happy. Maybe a server running on an Amiga, or a Thinkpad signed by Bjarne Stroustrup? Show the world how pretty your computer can be!

Rules

  1. Post On-Topic
  2. No Defaults
  3. Busy Screenshots
  4. Use High-Quality Images
  5. Include a Details Comment
  6. No NSFW
  7. No Racism or use of racist terms

Community stats

  • 1K

    Monthly active users

  • 679

    Posts

  • 5.5K

    Comments