Quantcast
Channel: Active questions tagged fish - Stack Overflow
Browsing all 92 articles
Browse latest View live
↧

Can I use nvim --remote to replace nvr?

I'm using neovim-remote/nvr to avoid nested instances of nvim when using the integrated terminal. This is the code:# config.fishif set -q NVIM # Avoid nested neovim instances with neovim-remote set -gx...

View Article


How to end the `read` command by ctrl c?

read -l -P "" numberif test -z "$number" set number 2end# do something e.g. echo "Processed"echo "Processed"I want to read something from the standard input and then do something, e.g. echo...

View Article

variable expansion on string not working for python script argument

I have a Python script that accepts an arg of --ips in a space separated manner. e.g. --ips 8.8.8.8 8.8.4.4. When I manually enter the IPS it works fine, and when I set IPS "8.8.8.8 8.8.4.4" and then...

View Article

How to get a list of IPs from Ansible yml inventory for use in a shell script?

How to get a list of all the IPs in an Ansible inventory for a pattern, for use in a script outside of Ansible?

View Article

How to make fish shell use an rvm ruby by default

I'm using fish shell 2.10 on Mac OS X 10.9.1. I would like to use a Ruby that I have installed using RVM as the default in my terminals, however I can't seem to make this work.I've tried rvm use 2.1.0...

View Article


Zsh global alias equivalent in fish shell

In Zsh I use the following global alias:alias -g L='| less --chop-long-lines'When executing echo "hello world" L in Zsh, less will display the sentence 'hello world'.How to write a fish function...

View Article

Fish: Compiler apparently not waiting the execution of previous command

Using Fish functions when I run "rmccw *"the *.out files are excluded, as expected, but the compiler doesn't run and I get this error:input file 'a.out' is the same as output filecollect2: error: ld...

View Article

Fish command substitution for arguments -- eval safe?

In fish shell, I want to be able to expand a command substitution or variable as multiple arguments to another command, e.g.:Without substitutionls -l -hShould give the same result as:ls $(echo '-l...

View Article


How can I specify PATH env var in fish shell in a declarative command

I want my $PATH environment variable to specifically contain 3 specific directories and nothing else.I don't want to use individual ADD and REMOVE commands to shape my $PATH variable.In Bash I can just...

View Article


How can you get doctl completion working in fish shell?

doctl is the digitalocean cli tool for interfacing with digitalocean resources via CLI.It has completion options built-in, for example you can run this command to enable bash completiondoctl completion...

View Article

'At least one out of multiple' conditional

I want to say:command1command2command3if not at least one of these yields status code 0, then launch command4The goal is to always execute all of them, and in case all fail, then execute command number...

View Article

How to ask for user input with a default answer

read -p 'set_color green; echo -n "$prompt Do you like to succeed? [Y/n]: "; set_color normal' -l confirm switch $confirm case Y y '' command case N n return 1So, I imagined '' would allow us to press...

View Article

View time taken of last command in fish shell

I'm aware that I can use time astime <some command>But this requires me to remember to type time before <some command>I'm wondering if it's possible create some sort of hook, so that time...

View Article


In Fish, how do I check that two paths are the same?

I'm trying to write an if statement that checks to see if two variables refer to the same file or directory. I can't simply compare the strings, because I want two different strings that refer to the...

View Article

How to use the python default interpreter instead of miniconda's base python...

My default python interpreter has been set to conda's base environment python interpreter. I would want my default /usr/bin/python3 to be the default.I've looked at this question which suggests that...

View Article


Does Fish shell cache the locations of previously-run commands?

I know in Bash and similar shells, there is the hash command, which gets run when the user runs a non-builtin command, and cleared when (for example) you update $PATH or run hash -r.And I know that the...

View Article

Append . to fish shell path

Despite the abundance of questions on how to set the path on the fish shell, I haven't been able to find the answer to this seemingly very simple one :I want to append . to my path (because I dislike...

View Article


ZFS Unknown command via ssh, but is in $PATH

I am trying to use syncoid to send a zfs dataset to a remote macOS machine, with OpenZFS on macOS installed.During the run, I get the error: fish: Unknown command: zfs.I can replicate this error with...

View Article

How to add Brew to path, Fish on Ventura

I've got Fish installed on Ventura (via the installer) as my default Shell. I've also installed Brew (via the installer).I've seen instructions for how to add it to .zsh profile, but how / where do I...

View Article

fish shell: filter $argv (lightweight / dynamic argparse)

I would like to split $argv into two variables. One with opts and one with everything else.function filter_opts set -l filtered_opts set -l new_argv for opt in $argv if string match -r -- '-.*' $opt...

View Article
Browsing all 92 articles
Browse latest View live




<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>