Today's article has you using the 'find' command...

for some reason, the "find ! -path" command needs the directories listed with wildcards like "./directory/*" to exclude them on my end. If you just list the directory, then it doesn't do anything. I'm sure find has changed a fair amount since the early 00's.
 


I see what's going on here. Since the 1990's I've been writing all my shell scripts in KSH. I was first introduced to it on the IBM RS6000. The KSH scripts don't translate too well to BASH. Bash can't handle math equations as easily as KSH (IMHO). At times, the decimal point seems give Bash indigestion. ;) Forgive me for being bold, but IMHO, KSH is WAY more powerful, intuitive and can handle math MUCH better then BASH.
The content of my post from yesterday was written for KSH.

As you might have heard, my system crashed a few weeks ago. I haven't recovered all of my script files as yet. I'm waiting until I'm comfortable with it before I restore stuff. :^) Once I do, I'll give my take on some of the differences between the two.

NOTE: I actually did start in BASH. However at the time, it could NOT return a variable from a subroutine. I literally had to write the output from the expression to a file and read it back in afterwards. Seemed silly to me.
 
Last edited:
I found this@ https://www.geeksforgeeks.org/korn-shell-vs-bash-shell/

Korn ShellBash Shell
1.The extension of the Korn shell is .ksh. The extension of the bash shell is .sh.
2.In the Korn shell, we use the print command for printing any output. In Bash shell, we use the command name echo printing any output.
3.The Korn shell can be found in /bin/ksh. We can find the bash shell in /bin/bash.
4.In terms of the execution of commands and scripts, the Korn shell is much better. In terms of the execution of commands and scripts, the performance is not like the Korn shell.
5.As they have old syntax, the scripts of the Korn shell are less readable. As they have the new syntax, the scripts of the bash shell are more readable.
6.The programming features provided by the Korn shell are much better than the bash shell. The programming feature provided by the bash shell is not better than the Korn shell.

This is why I prefer KSH.
I do take exception to #5 This is subject to the user and what programming languages they are familiar with. Just my 2¢
 
Re: point 2 in post #23, bash also uses the printf command to print output as well as the echo command.
 
I don't recall spending much time with KSH. I recall changing to default to KSH on a system years ago, with the goal being able to find out what all the (Slashdot) fuss was about. I dimly recall also playing with ZSH and FISH.

None of 'em really 'stuck' with me.
 
macOS switched from default bash to default zsh in 2019. Apple never stated why, but the common consensus is that Apple wants to avoid the GPL v3 (GNU General Public License version 3). According to some, under GPLv3, Apple would be forced to publish source code that they do not want to disclose.

The change from bash to zsh coincided with several other changes that had the same license issue. (Example: Apple removed the emacs editor at the same time. The emacs editor was included by default macOS prior to that.)
 
Ksh might be better, but im probably going to stick with bash sinces its more common.
Stick with bash until you get comfortable. Just don't be afraid to venture in to other shells. Eventually, you'll find "Your" shell. My point is, no matter how good you get at programming with a particular shell. Others still have a lot to offer.
Heck, you've already produced some pretty good scripts. The adventure is only beginning. :^D
 
Stick with bash until you get comfortable. Just don't be afraid to venture in to other shells. Eventually, you'll find "Your" shell. My point is, no matter how good you get at programming with a particular shell. Others still have a lot to offer.
Heck, you've already produced some pretty good scripts. The adventure is only beginning. :^D
I want to keep learning bash, machine languages (like C and assembly), java and python but its hard to hard to process such large amounts of information, at least for me.
 

Members online


Latest posts

Top