-
-
Save masih/10277869 to your computer and use it in GitHub Desktop.
#!/bin/bash | |
# Script for installing Fish Shell on systems without root access. | |
# Fish Shell will be installed in $HOME/local/bin. | |
# It's assumed that wget and a C/C++ compiler are installed. | |
# exit on error | |
set -e | |
FISH_SHELL_VERSION=2.1.1 | |
# create our directories | |
mkdir -p $HOME/local $HOME/fish_shell_tmp | |
cd $HOME/fish_shell_tmp | |
# download source files for Fish Shell | |
wget http://fishshell.com/files/${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/local --disable-shared | |
make | |
make install |
@dimtion +1
Worked just fine on CentOS 6. Thank you.
thx.
Notice that if version >= 2.5.0 , C++11 is required.
checking whether g++ supports C++11 features by default... no
checking whether g++ supports C++11 features with -std=c++11... no
checking whether g++ supports C++11 features with -std=c++0x... no
checking whether g++ supports C++11 features with +std=c++11... no
checking whether g++ supports C++11 features with -h std=c++11... no
configure: error: *** A compiler with support for C++11 language features is required.
Thanks a lot.
Installed successfully.
However, is there any way to make it the default shell without root?
@Lst0621 Not sure what Linux you are on but here are my notes on Ubuntu. Last incantation below is what you want.
Ubuntu - How do you change the default shell for ALL USERS to bash (or fish)?
http://askubuntu.com/questions/28969/how-do-you-change-the-default-shell-for-all-users-to-bash
If you use useradd, edit the /etc/default/useradd
skeleton file (don't forget to make a backup though). This will set bash as the shell for new users create.
For currents users run the following to change the default shell:
sudo -u <USERNAME> chsh -s /bin/bash
To change to the fish shell
sudo -u meos chsh -s /usr/bin/fish
A user can change their own default shell with:
chsh -s /usr/bin/fish
Current version as of my post is 2.7.1 (need to adjust FHISH_SHELL_VERSION)
Also, the path that is built in the script is no longer valid. I adjusted to use the github location for the files.
Line 17 - wget https://github.com/fish-shell/fish-shell/releases/download/${FHISH_SHELL_VERSION}/fish-${FHISH_SHELL_VERSION}.tar.gz
Installed last night from the scipt and everything worked great.
Why is the environment variable FHISH_SHELL_VERSION instead of FISH_SHELL_VERSION? Is it some kind of typo?
Thanks for pointing out the typo - they will outlive me I am sure...
I tried to install fish without root permission. My OS is Mac OS. And, fish version is FISH_SHELL_VERSION=3.0.2
.
But, I got something wrong when compiling.
I could compile after changing as following.
# extract files, configure, and compile
tar xvzf fish-${FISH_SHELL_VERSION}.tar.gz
cd fish-${FISH_SHELL_VERSION}
./configure --prefix=$HOME/local --disable-shared
mkdir build; cd build #please insert these two lines
cmake .. -DWITH_GETTEXT=OFF #need this option if using macos
make
make install
I read this issue. Thanks.
The URL needs to be updated a la https://github.com/fish-shell/fish-shell/releases/download/3.0.1/fish-3.0.1.tar.gz
I.e. replace line 10 with
FISH_SHELL_VERSION=3.0.1
and line 17 with
wget http://github.com/fish-shell/fish-shell/releases/download/${FISH_SHELL_VERSION}/fish-${FISH_SHELL_VERSION}.tar.gz
Updated script that can be used to install fish v3.5.1: https://gist.github.com/aidenlx/bfecf5f811a218a6b98bfdaedee8e8e6
I have a warning :
configure: WARNING: unrecognized options: --disable-shared
on fish 2.2.0 (ubuntu) is it due to an update ?