5 ms·
I love fish shell, I love the autocomplete, but I've been forced to switch back to bash lately, because fish syntax is just different enough from bash-isms to b
by Afforess 9y ago
I love fish shell, I love the autocomplete, but I've been forced to switch back to bash lately, because fish syntax is just different enough from bash-isms to break too much scripts / tools / commands.
I know I could just invoke bash, but prefixing commands with "bash -c '" is tiring and papercuts are why I switched to fish in the first place. I wish bash had a sane auto-complete prediction like fish.
- mixmastamyk 9y agoFish doesn’t break scripts, they use whatever interpreter you specified when you wrote them. I use fish interactively and write very simple scripts in bash and the more complex in Python.
- Skunkleton 9y agoMaybe op is sourcing said scripts instead of executing them?
- deleted 9y ago[deleted]
- iheredia 9y ago+1 I gave it a try a couple years ago and I remember having issues with RVM (Ruby Version Manager). Hope is fixed though
- kilovoltaire 9y agoIt is fixed, RVM supports Fish now - https://rvm.io/integration/fish https://rvm.io/integration/fish
- sigjuice 9y agoYour scripts should begin with #!/bin/bash or similar so you can execute them from anywhere. Are there bash built-in commands or functions that you need while in fish?
- racer-v 9y agoThere's some initial pain in retrofitting your Bash startup to work under fish, but after that it's worth it. For example I had to search for how to use ssh-agent with fish, and now it works great: https://github.com/st3fan/dotfiles/blob/master/fish/ssh.fish https://github.com/st3fan/dotfiles/blob/master/fish/ssh.fish You need to learn a few idioms like: replace $[1+1] with (math "1+1"); replace > for f in $(ls); do echo $f; done with > for f in (ls); echo $f; end I should start a Rosetta Stone of Bashisms to Fishisms - I'd be interested if anyone has got Android Open Source build environment / lunch working.
- tarboreus 9y agoYou might want to try (or revisit) zsh, which is closer to bash but has some nice features. Use oh-my-zsh for some nice theming and extra features. https://github.com/robbyrussell/oh-my-zsh https://github.com/robbyrussell/oh-my-zsh
- phillco 9y agopbpaste | bash -c? :D
- cup-of-tea 9y agobash uses readline to handle user input and in readline the completion function is a parameter. Could a more clever completion function be substituted to get the same behaviour with bash?
- clux 9y agoYou can get it much of the way there by tweaking `~/.inputrc` "\e[A": history-search-backward # Up key "\e[B": history-search-forward # Down key. Allows you to get press up while you have `ssh 10.2` in the terminal to cycle through ips matching, etc. It won't display like in fish before pressing it, but I find that's a reasonable tradeoff.
- deleted 9y ago[deleted]
- chubot 9y agoFWIW I'm working on a bash-compatible shell: http://www.oilshell.org/blog/ http://www.oilshell.org/blog/ If nothing else, I have thousands of lines of my own shell scripts that I don't care to move to a different shell syntax that's not obviously better :) There are lots of posts on the blog about it, but here is an example: "OSH Runs Real Shell Programs" - http://www.oilshell.org/blog/2017/07/02.html http://www.oilshell.org/blog/2017/07/02.html Another comment: https://news.ycombinator.com/item?id=15916470 https://news.ycombinator.com/item?id=15916470 However one thing is that it's not yet a good interactive shell. It's mainly treating bash as a programming language. However I think that is a good foundation for an interactive shell. Some details here: https://www.reddit.com/r/commandline/comments/7c3f9f/osh_02_parsing_one_million_lines_of_shell/dposm7r/ https://www.reddit.com/r/commandline/comments/7c3f9f/osh_02_...
- pbackx 9y agoI've had success with bass[1]. Typically, I use it when some kind of tool requires sourcing bash scripts. [1] https://github.com/edc/bass https://github.com/edc/bass