Secure ShellFish acts as a file provider in the Files app, meaning it can be configured as one of Files’ Location options. This enables access to the entire file structure of your compatible server, and comes with all the perks of integration with Files: drag and drop support, easy document transfers from one file provider to another, a strong set of keyboard shortcuts, tagging options,. Line shell for the 90s fish is a smart and user-friendly command line shell for Linux, macOS, and the rest of the family.
Install Fish Shell on Mac OS X and Ubuntu
Source: http://hackercodex.com/guide/install-fish-shell-mac-ubuntu/
The Fish shell goes where few command-line shells have gone before, shedding its forebearers’ POSIX baggage in favor of simplicity, consistency, and ease-of-use. Much like the Mac creators thought computers should be made to understand how humans work (and not the other way around), Fish observes your past behavior and suggests commands that it thinks you might be trying to execute. Sometimes, those suggestions are so spot-on that it can be downright spooky. Reactions of “How did Fish know that’s what I wanted to do?” are not uncommon.
In this article, we’re going to show how to install the recently-released Fish 2.1.0 on Mac OS X and Ubuntu, followed by some basic setup steps. Subsequent posts will cover more advanced configuration.
So can a command-line shell be Mac-like? Let’s find out.
What is Fish and why would someone use it instead of another shell?
Fish has a number of advantages over other shells:
- Fish suggests commands as you type based on history and completions, just like a web browser’s search bar
- Fish generates completions automatically by parsing your installed man pages
- Fish has a more intuitive syntax
- Fish has less historical baggage and technical debt
For additional background information, read:
- Fish: the friendly interactive shell — as described in 2005 by the original author
Installing Fish on Mac OS X 10.9 – Mavericks
There are several ways to install Fish on Mac OS X:
- traditional .pkg installer
- standalone Mac application
- Homebrew
- manual compilation
The first two options are available from the Fish web site and are straightforward enough to be considered self-explanatory.
That said, if you already use Homebrew (which I recommend) and have configured your environment as noted in the Mavericks Setup Guide, then you can install Fish as you would any other package:
Add Fish to /etc/shells, which will require an administrative password:
Make Fish your default shell:
Now that Fish is installed, you can proceed to the Basic Configuration section below.
Install latest Fish on Mac OS X from source
If you want to use the latest bleeding-edge version of Fish and already have Xcode installed, use the following steps to install from source:
Add Fish to /etc/shells, which will require an administrative password:
Make Fish your default shell:
Now that Fish is installed, you can proceed to the Basic Configuration section below.
Installing Fish on Ubuntu
On Ubuntu, the easiest way to keep up-to-date is via the offical PPA. If you prefer to install via .deb package, or if you want to install the bleeding-edge version of Fish from source, those instructions are further below.
Install Fish via PPA
The following steps will add the Fish 2.x PPA repository and install Fish:
Make Fish your default shell:
Now that Fish is installed, you can proceed to the Basic Configuration section below.
![Mac Mac](/uploads/1/1/9/5/119501337/486038831.png)
Install Fish on Ubuntu via .deb
The following steps are for the 64-bit version of Ubuntu 12.04 LTS. If you are using a different version of Ubuntu, you’ll need to retrieve an appropriate .deb package from the Fish on Linux page.
First retrieve and then install the .deb package:
Make Fish your default shell:
Now that Fish is installed, you can proceed to the Basic Configuration section below.
Install bleeding-edge Fish via PPA
If you prefer, you can keep up-to-date with the bleeding-edge version of Fish via the nightly build PPA. To do so, add the nightly PPA and install Fish:
Make Fish your default shell:
Now that Fish is installed, you can proceed to the Basic Configuration section below.
Install Fish on Ubuntu from source
Install dependencies:
Retrieve source, compile, and install:
Add Fish to /etc/shells:
Make Fish your default shell:
Now that Fish is installed, you can proceed to the Basic Configuration section below.
Basic configuration
The Fish shell should now be installed, but a bit more configuration will prove helpful later.
Create the Fish config directory:
Create initial config file:
Initial config file contents, which adds /usr/local/bin to the PATH environment variable:
Open a new terminal session, which should now load the Fish shell by default for the first time. You can enter help, followed by the return key, to load user documentation in your default browser.
You can also see your current configuration in your default browser by first entering this command:
… and then visiting http://localhost:8000/ in your browser of choice.
Fish can parse your installed man pages and automatically generate completion files for your command-line tools. You should periodically run the following command to update those completions, which are stored in ~/.config/fish/completions by default:
Last but not least, running:
… will eliminate the Fish welcome message that appears by default. If you want to add your own custom welcome message instead of removing the message entirely, insert your preferred text inside the ' marks.
Getting back to Bash
If you want to temporarily switch to the Bash shell for a single session, run:
When you are done with your Bash session, type exit to return to your Fish shell.
If you decide Fish isn’t for you and want to permanently revert your default shell back to Bash:
… will switch your default shell to Bash.
More coming soon
With Fish as your default shell, you may find that customizations you’ve made to your Bash environment are not present in Fish. The good news is that it’s easy to re-create those customizations — and create new enhancements — via Fish aliases and functions. The next article in this series will demonstrate some more advanced Fish capabilities, so stay tuned for more!
(Redirected from Friendly interactive shell)
The fish shell. Its tagline, 'fish - the friendly interactive shell', is displayed at top. | |
Original author(s) | Axel Liljencrantz |
---|---|
Developer(s) | ridiculousfish, siteshwar, JanKanis[1] |
Initial release | 13 February 2005; 15 years ago |
Stable release | |
Repository | |
Operating system | Unix-like |
Type | Unix shell |
License | GPL v2[3] |
Website | fishshell.com |
fish is a Unix shell that attempts to be more interactive and user-friendly than those with a longer history (i.e. most other Unix shells) or those formulated as function-compatible replacements for the aforementioned (e.g. zsh, the Falstad shell). The design goal of fish is to give the user a rich set of powerful features in a way that is easy to discover, remember, and use.[4] fish is considered an 'exotic shell',[citation needed] in that its syntax derives from neither the Bourne shell (ksh, Bash, zsh) nor the C shell (csh, tcsh). Also unlike previous shells, which disable certain features by default to save system resources, fish enables all features by default.
Highlights[edit]
Fish has 'search as you type' automatic suggestions based on history and current directory.This is essentially like Bash's Ctrl+R history search, but because it is always on instead of being a separate mode, the user gets continuous feedback while writing the command line, and can select suggestions with the arrow keys, or as in Bash, press Tab ↹ for a tab completion instead. Tab-completion is feature-rich, expanding file paths (with wildcards and brace expansion), variables, and many command specific completions. Command-specific completions, including options with descriptions, can to some extent be generated from the commands' manpages.
Fish has few syntactic rules, preferring features as commands rather than syntax. This makes features discoverable in terms of commands with options and help texts. Functions can also carry a human readable description. A special help command gives access to all the fish documentation in the user's web browser.[5]
Syntax[edit]
The syntax resembles a POSIX compatible shell (such as Bash), but deviates in important ways where the creators believe the POSIX shell was badly designed.[6]
No implicit subshell[edit]
Some language constructs, like pipelines, functions and loops, have been implemented using so called subshells in other shell languages. Subshells are simply child programs that run a few commands for the shell and then exit. Unfortunately, this implementation detail typically has the side effect that any state changes made in the subshell, such as variable assignments, do not propagate to the main shell, which may surprise the user. Fish never forks off so-called subshells; all builtins are always fully functional.
Variable assignment example[edit]
Fish Shell For Mac Os
This Bash example does not do what it looks like: because the loop body is a subshell, the update to
$found
is not persistent.Workaround:
Fish does not need a workaround:
Helpful error messages[edit]
Error messages in fish are designed to actually tell the user what went wrong and what can be done about it.[7]
Universal variables[edit]
Fish has a feature known as universal variables, which allow a user to permanently assign a value to a variable across all the user's running fish shells. The variable value is remembered across logouts and reboots, and updates are immediately propagated to all running shells.
Other features[edit]
- Advanced tab completion.
- Syntax highlighting with extensive error checking.
- Support for the Xclipboard.
- Smart terminal handling based on terminfo.
- Searchable command history.
Version 2 adds:
![For For](/uploads/1/1/9/5/119501337/747429626.jpg)
- Autosuggestions
- 256 terminal colors
- Web-based configuration
- Improved performance (by having more builtins).
Bash/fish translation table[edit]
Feature | Bash syntax | fish syntax | Comment |
---|---|---|---|
variable expansion: with word splitting and glob interpretation | or or | deliberately omitted | Identified as a primary cause of bugs in posix compatible shell languages[8] |
variable expansion: scalar | deliberately omitted | Every variable is an array | |
variable expansion: array | Quoting not necessary to suppress word splitting and glob interpretation. Instead, quoting signifies serialization. | ||
variable expansion: as a space separated string | |||
history completion | Ctrl+R | implicit | |
history substitution | !! | deliberately omitted | Not discoverable |
explicit subshell | no equivalent | ||
command substitution | |||
process substitution | Command, not syntax | ||
logical operators | |||
variable assignment | |||
string processing: replace | |||
string processing: remove prefix or suffix pattern, non-greedily or greedily | |||
export variable | Options discoverable via tab completion | ||
function-local variable | by default | ||
scope-local variable | no equivalent | ||
remove variable | |||
check if a variable exists | |||
array initialization | Every variable is an array | ||
array iteration | |||
argument vector: all arguments | |||
argument vector: indexing | |||
argument vector: length | |||
argument vector: shift | |||
array representation in environment variables | fish assumes colon as array delimiter for translating variables to and from the environment. This aligns with many array-like environment variables, like $PATH and $LS_COLORS. | ||
export and run | env LANG=C.UTF-8 python3 works in any shell, as env is a standalone program. | ||
arithmetic | expr 10 / 3 works in any shell, as expr is a standalone program. | ||
escape sequence | printf'e' works in both shells; their printf builtins are both compatible with the GNU printf standalone program.[9] | ||
single quoted string: escape sequences | Bash only requires replacement of the single quote itself in single quoted strings, but the replacement is 4 characters long. The same replacement works in fish, but fish supports a regular escape sequence for this, thus requires escaping backslashes too (except permits single backslashes that don't precede another backslash or single quote). |
See also[edit]
References[edit]
- ^'fish shell team members'. GitHub.com. Retrieved 2013-05-21.
- ^[1] Release Notes for fish 3.1.2
- ^fishshell.com License for fish
- ^Linux Weekly News. Fish - A user-friendly shell. Retrieved 2010-03-24.
- ^Linux.com. CLI Magic: Enhancing the shell with fish. Retrieved 2010-03-24.
- ^Paul, Ryan. 'An in-depth look at fish: the friendly interactive shell'. Ars Technica. Retrieved 10 March 2015.
the Posix syntax has several missing or badly implemented features, including variable scoping, arrays, and functions. For this reason, fish strays from the Posix syntax in several important places.
- ^Handle With Linux. Afraid of the command line? Try fish. Archived from the original on 2012-07-19.
- ^'Bash Pitfalls'. Retrieved 2016-07-10.
This page shows common errors that Bash programmers make. (…) You will save yourself from many of these pitfalls if you simply always use quotes and never use word splitting for any reason! Word splitting is a broken legacy misfeature inherited from the Bourne shell that's stuck on by default if you don't quote expansions. The vast majority of pitfalls are in some way related to unquoted expansions, and the ensuing word splitting and globbing that result.
- ^'printf does not support e'. fish issues. 11 Jul 2013. Retrieved 24 March 2016.
External links[edit]
- Official website – containing documentation and downloads
- fish on GitHub (active)
- fish on Gitorious (obsolete)
- fish on SourceForge (obsolete)
- Fish-users – general discussion list for fish users
- Shell Translation Dictionary - another Bash/Fish translation table
Fish Shell For Mac
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Fish_(Unix_shell)&oldid=985222259'