Live data from Hacker News

Fish shell 2.2

fishshell.com

31–40 of 73 posts

Re: Fish shell 2.2

#31
post #24
post #19

Earlier quoted context omitted.

I have several bash functions that need to be sourced to be included. For instance, I use `cdc` to change to my code directory, where I keep my source for projects I am working on. If I type `cdc name` it changes it to my projects source directory, save me a lot of keystrokes in a day as I have many that I flip between. This sourcing of a function is required due to the way cd is handled, and in it's current form, no…

You want $CDPATH for that in Bash.

CDPATH is not a very good bookmarking system, as you can't bookmark several directories that have the same name, and you are forced to bookmark all the siblings of the item you wish to bookmark, which can be a problem with flat hierarchies. So if bookmarking directories is the goal, CDPATH might not be the best way. And one off bookmarking functions are easy to write.

Admittedly for the description given, it does sound like CDPATH would work. But I'm going to assume there's a reason, and functions that change the current working directory are the perfect example of functions that can not be run in a subshell, so will have to be rewritten to fish, which is what the author was providing.

Re: Fish shell 2.2

#32
post #19

Earlier quoted context omitted.

> its not compatible with BASH's shell scripting, which means you often cant just run shell scripts written by others, you may have to reformat it a little first. What exactly do you mean by “Shell scripts”? If the script contains a proper Shebang you can easily run it via `./script.sh`. If not you use: `bash ./script.sh`.

I have several bash functions that need to be sourced to be included. For instance, I use `cdc` to change to my code directory, where I keep my source for projects I am working on. If I type `cdc name` it changes it to my projects source directory, save me a lot of keystrokes in a day as I have many that I flip between. This sourcing of a function is required due to the way cd is handled, and in it's current form, no…

Alternatively, you may want to look into z.

    https://github.com/rupa/z (bash, zsh)
    https://github.com/sjl/z-fish

Re: Fish shell 2.2

#33
post #7
post #2

Awesome! 90s, here I come!

Downvotes? Come on, the 90s were fantastic. I haven't heard of Fish before but what I said was meant as a supportive pat on the shoulder; projects like these are great. So whoever's pressing the down button, please, try to crack a smile, or at least stop ruining mine.

Comments which add little or no value to the discussion are discouraged by HN community mores [edit: the "avoid me too comments" has been removed from the guidelines but habits die hard]. The reason is illustrated by this subthread: such comments often devolve into metadiscussion about behavior and complaints about community norms.

The up arrow expresses support for the story. The delete link allows a person to revoke comments that don't merit upvotes. The edit link lets comments to be modified with supporting details, examples, evidence and rationales that contribute to HN'ers understanding and knowledge by extending the content.

That's more constructive than complaining about downvotes and implying that people don't get it.

Re: Fish shell 2.2

#34
post #7
post #2

Awesome! 90s, here I come!

Downvotes? Come on, the 90s were fantastic. I haven't heard of Fish before but what I said was meant as a supportive pat on the shoulder; projects like these are great. So whoever's pressing the down button, please, try to crack a smile, or at least stop ruining mine.

I think the downvotes are because you completely failed to grasp what Fish shell is. It is a newer more modern shell than bash not some type of retro 90's toy.

Re: Fish shell 2.2

#35
post #31
post #24

Earlier quoted context omitted.

You want $CDPATH for that in Bash.

CDPATH is not a very good bookmarking system, as you can't bookmark several directories that have the same name, and you are forced to bookmark all the siblings of the item you wish to bookmark, which can be a problem with flat hierarchies. So if bookmarking directories is the goal, CDPATH might not be the best way. And one off bookmarking functions are easy to write. Admittedly for the description given, it does sou…

I simplified the example, cdc does more than just a change the directory. `cdc -t name` changes to the directory and attaches to the tmux session of the same name if it exists, and if it doesn't, sets up my tmux layout for development.

Re: Fish shell 2.2

#37
post #35
post #31

Earlier quoted context omitted.

CDPATH is not a very good bookmarking system, as you can't bookmark several directories that have the same name, and you are forced to bookmark all the siblings of the item you wish to bookmark, which can be a problem with flat hierarchies. So if bookmarking directories is the goal, CDPATH might not be the best way. And one off bookmarking functions are easy to write. Admittedly for the description given, it does sou…

I simplified the example, cdc does more than just a change the directory. `cdc -t name` changes to the directory and attaches to the tmux session of the same name if it exists, and if it doesn't, sets up my tmux layout for development.

Ok. I didn't know about cdc.

Re: Fish shell 2.2

#38
post #7

Earlier quoted context omitted.

Downvotes? Come on, the 90s were fantastic. I haven't heard of Fish before but what I said was meant as a supportive pat on the shoulder; projects like these are great. So whoever's pressing the down button, please, try to crack a smile, or at least stop ruining mine.

I think the downvotes are because you completely failed to grasp what Fish shell is. It is a newer more modern shell than bash not some type of retro 90's toy.

I think you're failing to get his reference. The title of the fish shell home page: "Finally, a command line shell for the 90s".

Re: Fish shell 2.2

#39
post #36
post #9

Awesome! Remove the built-in web server and count me in!

The built-in web server is optional anyway.

Via configuration, but it's bundled into the code. I'd rather have the web server as an optional install.

Re: Fish shell 2.2

#40
post #25
post #5

My main gripe with a shell like Fish is that it won't work with the trusted ol' BASH scripts. Seeing as I deal with quite some BASH scripts on a day-to-day basis at work this keeps me from trying it out, even though I'd love to be able to use something more sophisticated/evolved than plain BASH.

My main gripe with 'BASH scripts' is that in most cases they could simply be 'Shell scripts' and in most cases they call and require Bash for no reason at all ;)

I guess most people cannot be bothered to remember which features are bash specific and which will work in any /bin/sh. I don't think there is such a thing as a generic "shell script", csh has completely different syntax.
Post reply on HN