From cda49c518529c089b7392a2f11312092ea5849df Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Fri, 4 Jul 2025 20:58:35 -0400 Subject: Update arch script and pull oksh compiling into its own script --- compile/oksh.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 compile/oksh.sh (limited to 'compile') diff --git a/compile/oksh.sh b/compile/oksh.sh new file mode 100755 index 0000000..1a44c0f --- /dev/null +++ b/compile/oksh.sh @@ -0,0 +1,31 @@ +#!/bin/sh +set -ex +codedir="$HOME/scm/pub" +okshdir="${codedir}/ibara-oksh" +if ! [ -d "$okshdir" ] ; then + git clone https://github.com/ibara/oksh "$okshdir" +fi +cd "$okshdir" +git checkout oksh-7.6 +./configure +make +sudo make install +cd - + +if ! grep /usr/local/bin/oksh /etc/shells ; then + sudo sh -c 'echo /usr/local/bin/oksh >> /etc/shells' +fi + +if ! grep -qF 'export ENV=$HOME/.kshrc' ~/.profile; then + echo 'export ENV=$HOME/.kshrc' >> ~/.profile +fi + +set +x +if ! grep ^$(id -un) /etc/passwd | grep /usr/local/bin/oksh ; then + printf "Change shell to oksh? [y]es/[n]o: " + read -r resp + if [ "$resp" = "y" ] ; then + chsh -s /usr/local/bin/oksh + fi +fi +set -x -- cgit v1.2.3