Which Korn shell do you use? I use ksh93, myself, but OpenBSD's ksh is alright, too.
Which Korn shell do you use? I use ksh93, myself, but OpenBSD's ksh is alright, too
Other urls found in this thread:
youtu.be
shellcheck.net
twitter.com
BOOM ta da BOOM NOMMA NEEMA
SSSSSUMTHIN TAKES A PART OF MEEEEEee
based and Davis-pilled.
dubs confirm
convince me why it'd be worth the trouble to switch from bash.
i use zsh which i don't think is a korn shell. or is it? idk
I'm content with TCSH
thread theme
youtu.be
There is some good book / learning material on OpenBSD ksh?
Seriously go to a tall mosque, walk in, tap someone on the shoulder while they're praying and ask them if this is the gay bar or whether they can take you to the mosques gay bar
man ksh
kek
>Seriously go to a tall mosque, walk in, tap someone on the shoulder while they're praying and ask them if this is the gay bar or whether they can take you to the mosques gay bar
mksh. The white man's choice.
Teach me your ways.
The most comfy one that I've tried is mksh. It's also the lightest I've seen. Maybe it's just placebo, but it just feels faster.
Depending on your philosophy when it comes to software, bash might be considered "bloat". To me it doesn't matter that much and I just go with the default most times, but it's something to consider if you're into the whole software minimalism thing.
zsh is not a korn shell. The korn shells to my knowledge are original AT&T ksh, pdksh (the public domain clone), openbsd ksh and mirbsd ksh (forks off of pdksh by BSDs. the latter is often called mksh), and ksh93, which was when the OG ksh finally got freed and then updated with new features.
ksh93 is AT&T Korn shell, though. It's just the latest version, unlike ksh88.
It's free but under some weird license. Wish they'd re-license it but that probably takes time.
ksh93 has stellar POSIX compliance for anyone who cares about standards, and has a bunch of great features for people who disdain standards. The best of both worlds.
How do I set the promt on mksh? Is there a POSIX way to change PS1?
export PS1='Prompt Here: '
But what if I want to have a dollar symbol as a normal user but a hash as a root? Is there a POSIX for that?
There is no POSIX way to do that. POSIX has no escape sequences for PS1 except !, which gets converted to the current history number. OpenBSD ksh has some other escape sequences, but it doesn't seem like mksh does.
Any program or script that can check if a script is POSIX and convert it or at least mark it?
Apparently export='$ ' works on Bash and mksh which is enough for me.
shellcheck.net
If you use #!/bin/sh as your first line it will spot all non-POSIX behavior it knows of.
How to replace the following Bash configuration in mksh
# History length.
HISTFILESIZE=2000
# Don't put duplicate lines or lines starting with space in the history.
HISTCONTROL=ignoreboth
# Append to the history file, don't overwrite.
shopt -s histappend
# Check window size after each command,
# update LINES and COLUMNS values if necessary.
shopt -s checkwinsize
# Pattern "**" used in a pathname expansion context will match all
# files and zero or more directories and subdirectories.
#shopt -s globstar
# Bash programmable completion.
# Not necessary if enabled in /etc/bash.bashrc or /etc/profile.
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion;
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion;
fi
fi
I don't know how to do that. You just use it I guess. And you'll naturally learn more about it over time.
Just use bash.
I know how to use csh and tcsh, I just don't know what the reasons are to use it. What do you like about it? What do you enjoy? What makes you feel happy and warm inside when you use it?
>What makes you feel happy and warm inside
I'm sorry, I have to go to bed.
Wrote any shell scripts lately?
But what if I want a shell that isn't horribly slow?
Yes.
Defend this, mksh users.
start=$(date +%s.%N)
i=1
while [ $i -le 1000000 ]
do
printf "$i\n"
i=$((i+=1))
done
end=$(date +%s.%N)
duration=$(printf "$end-$start\n" | bc)
printf "time: $duration\n"
dash (v0.5.10.2): 3.6 seconds
bash (v5.0.7): 7.9 seconds
ksh (v2020.0.0): 8.7 seconds
mksh (v57): 547.2 seconds
zsh (v5.7.1): 5.8 seconds
I've been writing them in PowerShell and I like it.
Nobody can say Bash is not superior anyway, I just use mksh for a desktop
Then mksh is just the right shell for you.
Defend this, non-mksh users.
start=$(date +%s.%N)
cat durationtest2.sh
for i in $(seq 10000) ; do
ls > /dev/null
done
end=$(date +%s.%N)
duration=$(printf "$end-$start\n" | bc)
printf "time: $duration\n"
#!/bin/mksh 16.791583328
#!/bin/zsh 21.138428822
#!/bin/dash 15.714005133
#!/bin/bash 18.073906452
Your example looks different if you remove the printf. For some reason, mksh is just slow at printing, I'd like to know why.
start=$(date +%s.%N)
i=1
while [ $i -le 1000000 ]
do
i=$((i+=1))
done
end=$(date +%s.%N)
duration=$(printf "$end-$start\n" | bc)
printf "time: $duration\n"
#!/bin/mksh 6.951264639
#!/bin/zsh 6.717886013
#!/bin/dash 2.780597601
#!/bin/bash 9.082541582
>Defend this, non-mksh users.
What is there to defend? If anything your results make it clear that there's no reason to use mksh. If you want speed then go with dash, if you want extended functionality go with bash or ksh.
Is there some test script to properly test shell performance? Something that tests a bunch of different functions?
dash isn't usable as an interactive shell. I'm using it as login shell.
For interactive shells, I think mksh is better than any non-ksh alternative. And I'm not really sure why nobody uses ksh93.
Don't forget to post uname -a with your benchmarks. Different OSes will have different behaviors.
Also be clear about whether you mean ksh88, ksh93, or ksh93-devel for the actual ksh.
Bash for a production machine
mksh for a minimal desktop
The other shells are a meme with the exception of dash but that is not for general use
up
Why is mksh still not allowed in pkgs?
Fuck openmeme
They have their own ksh. There aren't really a lot of reasons to have it, I guess?
It's blacklisted. They really dislike the developer for some reason.
The superior ksh93 is already available.
Well it's the shell from MirBSD, which was an OpenBSD fork. Maybe there was some falling out. Assuming of course that it's still maintained by a MirBSD dev.