Questions tagged [fish]

Fish is a unix shell with a clean design and a limited but powerful feature set.

Fish (friendly interactive shell) is a relatively new unix . It provides advanced interactive features such as command and argument completion, and syntax coloring. Fish has a simpler syntax than Bourne-style shells.

Links and documentation

238 questions
17
votes
1 answer

Run a command only if the previous command was successful in Fish (like && in bash)

Using Bash I've often done things like cd /study && ls -la I understand that the double ampersand is telling the terminal don't execute part two of this command unless part one completes without errors. My question is, Having just moved to the Fish…
Nathaniel
  • 430
17
votes
2 answers

How to edit the fish shell startup script?

Is there a way I can do something like run myscript.sh in fish ? I am using Arch Linux, and have installed the fish shell together with oh-my-fish Can someone tell me which file I must edit to add my custom shell startup commands? In zsh it was the…
Mr Mixin
  • 273
9
votes
2 answers

In the Fish shell, how can I join an array with a custom separator?

I have an array whose elements may contain spaces: set ASD "a" "b c" "d" How can I convert this array to a single string of comma-separated values? # what I want: "a,b c,d" So far the closest I could get was converting the array to a string and…
hugomg
  • 5,747
  • 4
  • 39
  • 54
8
votes
1 answer

Run fish script in background?

I'd like to always run a fish script in the background even if the user doesn't specify that. In bash, this can be done by surrounding the script with ( at the start and ) & at the end. Is there anyway for a fish script to run itself in the…
7
votes
1 answer

Bash's Process Substitution "<(command)" equivalent in fish shell

In bash, I usually do grep -f <(command) ... (I pick grep just for example) to mimic a file input. What is the equivalent in fish shell? I cannot find it in the documentation.
annahri
  • 2,075
6
votes
1 answer

Print tab character in fish

In bash I could either do echo -e "a\tb" or echo a$'\t'b. How do you do this in fish?
Tyilo
  • 5,981
6
votes
1 answer

How to stop fish shell from underlining path?

The fish shell will underline a path given as an argument to a command such as ls. Is there a way to change that behavior since I find it very ugly? For example:
ChiseledAbs
  • 2,243
5
votes
1 answer

Why does the fish shell need to start a daemon process?

I just started playing with the fish shell, and I really like is so far. However, I can't figure out what the purpose of fishd is. So, why does fish need to start up a daemon process? What is the daemon process used for?
HSchmale
  • 427
4
votes
2 answers

How to group multiple conditions in an if statement in fish

As is, the code below is invalid, because the brackets can not be used like that. if we remove them, it runs fine, and outputs: true true code: #!/usr/bin/fish if ( false ; and true ) ; or true echo "true" else echo "false" end if false ;…
hoijui
  • 731
4
votes
1 answer

Execute bash command inside fish function

I decided to try fish shell, and I'm having trouble with some aliases. So I guess the painless way of doing the things would be executing the bash commands inside fish shell functions. Something like that : function fish_function start bash ...…
tjbrn
  • 203
  • 2
  • 6
3
votes
2 answers

FISH: failed to execute process...variable exceeds the OS argument length limit

I keep getting an error when I cd to my project root directory that is on github: > cd ~/go/src/github.com/mygithub/myapp The below message auto pops up because I am using tide prompt which links with github status. > exec: Failed to execute process…
3
votes
1 answer

fish shell : capture multi-line output to a variable with piping or read

if you curl https://www.toptal.com/developers/gitignore/api/python you see the file as expected, with newlines. But if I set response (curl https://www.toptal.com/developers/gitignore/api/python) echo $response in fish the newlines are gone. I've…
Chris F Carroll
  • 386
  • 1
  • 3
  • 10
3
votes
3 answers

Fish shell slow to respond when command does not exist

When I write a command that does not exist in the fish shell (let's say l instead of ls), fish takes some time before responding that the command does not exist. I don't know if it looks for package to install or something else, but it is a bit…
antoyo
  • 443
3
votes
2 answers

Why doesn't set -x work within eval within a function in fish?

I ran into an issue trying to dynamically set some variables based on output of a program, in a fish function. I narrowed my issues down to a MWE: function example eval (echo 'set -x FOO 1;') end calling: >example >echo $FOO results in no…
3
votes
2 answers

how to set and use multiple parameters in single environmental variable in fish shell

I want to use following in fish shell: $ export arm='ARCH=arm CROSS_COMPILE=arm-eabi-' $ make $arm This works fine in bash/zsh but not on fish shell. But if I execute the following in fish shell: $env tmp=arm make this works fine. Can someone…
1
2 3