News for hackers. Stuff that matters.
Re:Fish: A user-friendly command line shell for macOS, Linux... by Afforess on Tuesday December 12, 2017 @08:09PM (#15911113)
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.

Re:Fish: A user-friendly command line shell for macOS, Linux... by mixmastamyk on Tuesday December 12, 2017 @08:12PM (#15911139)
Fish 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.

Re:Fish: A user-friendly command line shell for macOS, Linux... by Skunkleton on Tuesday December 12, 2017 @08:14PM (#15911151)
Maybe op is sourcing said scripts instead of executing them?
Re:Fish: A user-friendly command line shell for macOS, Linux... by tarboreus on Tuesday December 12, 2017 @08:47PM (#15911331)
You 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

Re:Fish: A user-friendly command line shell for macOS, Linux... by racer-v on Tuesday December 12, 2017 @08:35PM (#15911263)
There'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

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.

Re:Fish: A user-friendly command line shell for macOS, Linux... by sigjuice on Tuesday December 12, 2017 @08:16PM (#15911174)
Your 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?
Re:Fish: A user-friendly command line shell for macOS, Linux... by chubot on Wednesday December 13, 2017 @01:57PM (#15916506)
FWIW I'm working on a bash-compatible shell:

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

Another comment: 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_...

Re:Fish: A user-friendly command line shell for macOS, Linux... by clux on Wednesday December 13, 2017 @07:06AM (#15913697)
You 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.

Re:Fish: A user-friendly command line shell for macOS, Linux... by pbackx on Tuesday December 19, 2017 @05:06AM (#15959113)
I'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

Re:Fish: A user-friendly command line shell for macOS, Linux... by iheredia on Tuesday December 12, 2017 @08:15PM (#15911170)
+1 I gave it a try a couple years ago and I remember having issues with RVM (Ruby Version Manager). Hope is fixed though
Re:Fish: A user-friendly command line shell for macOS, Linux... by kilovoltaire on Tuesday December 12, 2017 @08:17PM (#15911184)
It is fixed, RVM supports Fish now - https://rvm.io/integration/fish
Re:Fish: A user-friendly command line shell for macOS, Linux... by phillco on Wednesday December 13, 2017 @12:20AM (#15912207)
pbpaste | bash -c? :D
Re:Fish: A user-friendly command line shell for macOS, Linux... by cup-of-tea on Wednesday December 13, 2017 @04:03AM (#15913028)
bash 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?