Skip to content

Instantly share code, notes, and snippets.

@AnalogCyan
Forked from masih/fish_shell_local_install.sh
Last active January 27, 2024 07:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AnalogCyan/11bb7441c522f0fb03738340da6877b9 to your computer and use it in GitHub Desktop.
Save AnalogCyan/11bb7441c522f0fb03738340da6877b9 to your computer and use it in GitHub Desktop.
Install fish without root access
#!/bin/bash
# Script for installing Fish Shell on systems without root access.
# Fish Shell will be installed in $HOME/bin/apps/fish.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
FISH_SHELL_VERSION=3.0.2
# create our directories
mkdir -pv $HOME/bin/apps/fish $HOME/fish_shell_tmp
cd $HOME/fish_shell_tmp
# download source files for Fish Shell
wget https://github.com/fish-shell/fish-shell/releases/download/${FISH_SHELL_VERSION}/fish-${FISH_SHELL_VERSION}.tar.gz
# extract files, configure, and compile
tar xvzf fish-${FISH_SHELL_VERSION}.tar.gz
cd fish-${FISH_SHELL_VERSION}
./configure --prefix=$HOME/bin/apps/fish --disable-shared
make
make install
# add command to user's bin
touch $HOME/bin/fish
echo -e "#!/bin/sh\n~/bin/apps/fish/bin/fish" > $HOME/bin/fish
chmod +x $HOME/bin/fish
# remove temporary directories
rm -rf $HOME/fish_shell_tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment