Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [fish]

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

Filter by
Sorted by
Tagged with
1 vote
2 answers
98 views

test standard output with fish

I have a script that prints a string to terminal, and I want to check value of myScript output.(in this case resultString) I tried with this method, but it didn't worked. (for simplicty i replaced my ...
user avatar
1 vote
1 answer
78 views

Resume n jobs to background concurrently

I have many paused jobs in my shell. I would like to run bg for all of the jobs with a maximum four jobs running concurrently. I know I can use GNU parallel for new tasks but I would like a BASH or ...
user avatar
0 votes
2 answers
324 views

run for loop with bash command in fish shell

I'm trying to run a simple command on my fish shell, but I am not able to execute. It just keeps adding lines for me to add additional data to, not sure on how to execute accordingly. $ for acc in `...
user avatar
1 vote
1 answer
1k views

How to fix Error: Whenever I type something in terminal there is an error

I use fish as my login terminal. I was trying to run android simulator. I already edited my bash profile so I switched to bash by typing bash. I restarted my terminal after I logged off my computer ...
user avatar
  • 111
4 votes
1 answer
927 views

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.
user avatar
  • 1,580
0 votes
1 answer
85 views

How to lock my session as soon as I login?

I'm on Manjaro Gnome (using fish) and I want to enable Automatic Login and then force the session to lock. The idea being that I can boot and walk away from my computer, knowing that it will continue ...
user avatar
  • 93
0 votes
1 answer
283 views

How can I get numbers in fish history

I'm using fish shell but the history command in this returns something like ls cd Downloads ls mkdir new_folder whereas, the same thing in zsh would return 399 ls 400 cd Downloads 401 ls 402 mkdir ...
user avatar
  • 101
0 votes
2 answers
121 views

Get count of occurrences of each word in document

How can I find count of every word in a file? I want a histogram of each word in text pipe or document. New line and empty lines will exist in document. I stripped everything except for [a-zA-Z]. > ...
user avatar
  • 623
1 vote
1 answer
1k views

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) ...
user avatar
1 vote
1 answer
20 views

fish alternatives for [[ pattern tests ]]

Trying fish, I am stuck on some bash conditionals using [[ ... ]]. It looks like [ ... ] is the usual thing, but I'm stuck on pattern and regular expression tests: [[ "$PATH" =~ "$1&...
user avatar
1 vote
1 answer
154 views

fish equivalent of ${this:-that} expansion and similar

Trying fish, I am stuck on equivalents for some of the variable expansions from bash: x=${this:-$that} x=${this:-that} How do I do that in fish?
user avatar
4 votes
1 answer
576 views

kill %1 equivalent in fish

In bash, if I run kill %1, it kills a backgrounded command in the current shell (the most recent one, I believe). Is there an equivalent of this in fish? I haven't been able to find it online in a bit ...
user avatar
  • 143
1 vote
0 answers
305 views

Set permanent environment variable for all shells

I want to set the root level environment variable that comes from sh(1) so that it is shared across all shells: sh, bash, zsh, and fish. I can see in /etc/profile there's a command /usr/libexec/...
user avatar
  • 623
1 vote
2 answers
1k views

Error starting the fish_config web ui in WSL

I want to customize my fish shell using the Web UI mode, but when running fish_config colors, the following error is shown. surface@Surface ~> fish_config starting-colors Web config started at file:...
user avatar
  • 51
2 votes
2 answers
1k views

check if variable is null in fish

I want to check a condition if a variable is null in fish(friendly interactive shell). if test "$argv" = null # do something... else # do something else...
user avatar
0 votes
2 answers
275 views

Stop fish complaining: fish: $? is not the exit status. In fish, please use $status

I am building a script that should work in csh, bash, and fish with no change: This does the right thing in all the shells, perl -e '$bash=shift;$csh=shift;for(@ARGV){unlink;rmdir;}if($bash=~s/h//){...
user avatar
  • 29.7k
2 votes
1 answer
269 views

How to put the time string into the fish shell's prompt?

Currently I use this theme for fish, installed using fisher. This is how it shows up now: I would like the time string (e.g. 19:19) to be shown before the /m or after react or after the part with ...
user avatar
3 votes
1 answer
229 views

Terminal fish prompt blank

So I'm trying to change my fish shell terminal prompt but every time I change anything too complicated (beyond colour changes and rearranging the prompt), it just turns up blank. I'm running Arch ...
user avatar
3 votes
1 answer
2k views

How can I make xfce4-terminal start fish shell?

I want to use FISH shell. But I've read FISH is not a POSIX shell so setting it to default shell by chsh is not recommended. What I want is whenever I start xfce4-terminal I would like to start FISH ...
user avatar
0 votes
3 answers
1k views

TMUX and terminal colors are not the same locally and over ssh

I have a bunch of dotfiles that allow me to have a pretty theme on my terminal and tmux on my local host. I use kitty, fish and tmux. To properly define colors and have a global coherence, I use the ...
user avatar
  • 101
1 vote
1 answer
268 views

Enabling fish-style manpage-based completion in bash

One of the really appealing features of fish is that it supports intelligent tab completion of options based on their specifications in each command's respective manpage. Has anyone created a way to ...
user avatar
  • 111
0 votes
0 answers
67 views

Fish shell error

When I type command in fish shell, after command it returns: Could not send own process 401, 'sed' in job 3, 'commandline | sed 's|\s\+|\x1e|g'' from group 400 to group 400 setpgid: unknown error (...
user avatar
2 votes
1 answer
172 views

fish equivalent for sequence of commands -- { cmd1 ; cmd2; }

In bash, you can pipe the same output to two commands using {}, i.e. in the following: cmd0 | { cmd1 ; cmd2 ;} | cmd3 cmd1 and cmd2 get the output of cmd0 in their stdin, and cmd3 gets the output of ...
user avatar
2 votes
1 answer
392 views

Fish shell, disable pager navigation through Tab / Shift Tab

Fish is a great shell (the best?) but its completion interface has a particular quirk that I personally don't like and would like to disable. It's expressed by this sentence in the tutorial: Hit ...
user avatar
  • 537
0 votes
0 answers
92 views

I'm not able to figure out why fish-shell is not able to read my scripts directory from $PATH

After my failed attempt to unify my bash and fish configuration, I have finally separated both and 'hoping' that things should be fine now. As per the suggestions I received (against trying to re-use ...
user avatar
2 votes
2 answers
1k views

Starting Fish terminal from bashrc breaks standard terminal input

I've added a command to start fish terminal from bashrc and so far it was working ok. I've just added this line at the end of bashrc fish But after I quit fish to default shell current input isn't ...
user avatar
  • 123
2 votes
4 answers
2k views

sed replace newline character with space

How can I use sed to replace new line character with any other character? Input: I cannot conceive that anybody will require multiplications at the rate of 40,000 or even 4,000 per hour ... ...
user avatar
  • 623
0 votes
1 answer
293 views

Permission denied in fish shell on Debian when I edited the oh-my-fish "theme" file

I edited the "theme" file to display "bobthefish" instead of "default" using Windows. <W> fish: An error occurred while redirecting file “/home/purplesci/.config/omf/theme” open: Permission ...
user avatar
0 votes
0 answers
60 views

Symbols showing on blue background in Debian with oh-my-fish on WSL

I am using fish-shell on Debian with oh-my-fish installed. When I run the shell, it shows the prompt not on the black bckground, but on the light blue instead. This is running in Windows Terminal ...
user avatar
1 vote
0 answers
2k views

Unable to execute bash scripts from within fish-shell

I have a collection of bash scripts that I have added to the PATH so that I can execute them from anywhere. export PATH=$PATH:~/<path>/<to>/<scripts> so along with ./<path>/&...
user avatar
0 votes
1 answer
656 views

Set default interpreter in fish shell

I've installed mill on arch linux with fish as my default shell. Since the file /usr/bin/mill doesn't start with a shebang, fish won't execute the file. Instead it responds with $ mill Failed to ...
user avatar
1 vote
1 answer
424 views

Automatically print number of lines of command line output

In my fish shell, I am using fish command timer to automatically show the duration of each command after it has been executed. This is a neat feature, which I recommend. Now I want something similar ...
user avatar
4 votes
0 answers
102 views

Tracing environment variable modification in the fish shell

There's one item I used to use in $PATH, which is ~/.workspace/bin. I can't figure out where it's coming from. I changed the user shell to /bin/sh, logged in from TTY, checked $PATH, and it was clear ...
user avatar
  • 223
3 votes
2 answers
227 views

Issue with type force PATH search

This is Bash. The behavior is similar in fish. $ which python /usr/bin/python $ alias py=python $ type py py is aliased to `python' ​And then, running type -P py prints nothing, where as I expected ...
user avatar
  • 167
1 vote
2 answers
2k views

How to install fish in a remote server I cannot sudo?

I want to install the fish shell in a remote server I have no sudo privileges at, so that I can use it whenever I ssh.
user avatar
4 votes
1 answer
1k views

Does one string contain another in fish shell?

I am working on my fish.config for using the fish shell. I am trying to compare strings using bash syntax but fish doesn't accept the syntax. There is clearly another way to do it. Any suggestions ...
user avatar
8 votes
3 answers
8k views

fish shell : exec format error

On an Ubuntu ($ uname -a : Linux kumanaku 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux), I just installed fish ($ fish --version : fish, version 2.7.1) ...
user avatar
4 votes
2 answers
2k views

How to use fish on remote servers that have it installed without changing login shell?

I regularly ssh on several different servers, some of which don't have fish installed, but many do. I'd like to get fish as shell if available (changing midway is always tedious, and you lose the ...
user avatar
0 votes
1 answer
859 views

Terminal shows non-ascii? characters in UTF-16 hex codes

todoroki@todoroki-VJZ13B ~>printf "ä\n" echo "ä" ä ä ä \udcc3\udca4: \u30b3\u30de\u30f3\u30c9\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093 ...
user avatar
  • 111
2 votes
4 answers
1k views

Define function in fish, use it with watch

I want to define a function, and call that function every n seconds. As an example: function h echo hello end Calling h works: david@f5 ~> h hello But when using watch, it doesn't... watch ...
user avatar
6 votes
1 answer
11k views

Why I can't add fish to /etc/shells?

I'm trying to use fish shell as my default shell on OSX. I have installed fish shell using brew and when I wanted to add it to /etc/shells I got this error: tee: /etc/shells: No such file or ...
user avatar
3 votes
1 answer
140 views

Bash operator translation to fish

I've been trying to learn to use jq and for bash it uses the <<< operator which I cannot understand after reading the bash documentation, what is this operator for? Besides that, I use the ...
user avatar
  • 53
0 votes
2 answers
3k views

Yum not finding packages from added repo [CentOS 7]

I am currently trying to install fish on a new CentOS 7 machine. Followed the very straightforward guide which was: cd /etc/yum.repos.d/ wget https://download.opensuse.org/repositories/shells:fish:...
user avatar
  • 23
2 votes
1 answer
853 views

Print and log stdout and stderr in fish shell

I am using the fish shell and try to log stdout and stderr into two separate files and printing them in the terminal at the same time (e.g., by piping each stream to tee). In bash I would do (see ...
user avatar
  • 123
0 votes
2 answers
933 views

fish-shell: shortcut "ctrl-L"

I´m a keen user of the fish-shell and I like it a lot. One question though: on the page https://fishshell.com/docs/2.1/index.html there is a paragraph entitled "Command line editor". It lists a lot ...
user avatar
  • 141
0 votes
1 answer
237 views

Terminal prompts have a mysterious [I] in it

I have been using fish shell for a while, but only recently got into playing around with the oh-my-fish framework and theming the prompt. I cannot figure out what this [I] character means! In most ...
user avatar
0 votes
2 answers
1k views

Temporarily Set $PATH for a fish Shell Session From a Script

I want to prepend a couple directories to the $PATH variable temporarily so that I can set up a temporary development environment that I don't really want to change what other fish sessions see. So ...
user avatar
  • 143
13 votes
3 answers
6k views

How to access bash aliases in fish

I am missing my bash aliases in fish, and don't want to manually convert all of them to fish functions. How to get access to them all from within fish? Bonus points if: the solution supports an ...
user avatar
  • 389
1 vote
2 answers
392 views

Processing local variable with regular expressions

I have some video files in source/ to encode and I want the output to be saved in the local directory, therefore removing source/ in the filename. I accomplished this by using the following command ...
user avatar
4 votes
2 answers
2k views

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 ...
user avatar
  • 389