News for hackers. Stuff that matters.
Re:The fish shell is amazing by dangus on Thursday November 25, 2021 @12:00PM (#29342923)
If your bash script has a shebang you shouldn’t need bass at all. Fish will read the shebang and just run your script with bash.

The only thing I ever used bass for was this edge case where at work the way we login to AWS is using this Okta AWS integration that prints out a list of export commands.

Since fish isn’t compatible with bash export commands, I just run that command result through bass, which automatically converts them to the fish set -x commands.

If I remember right, I think the reason why the bash script my company made didn’t work is that the export commands that were run in bash weren’t propagated to the underlying fish environment. I was using fish to run a script with a separate shell, so it didn’t affect my environment variables.

Or maybe it was because running exec inside a bash script throws you back into fish which then can’t understand the export command.

I could have definitely done my own thing with sed/awk instead, but I suck at those tools and someone else already implemented the functionality in bass.

    bass exec aws_okta_thing_that_prints_export_commands_to_stdout
(Off the top of my head, I think it was something like that, could be misremembering! And by this comment you might be able to tell that I’m far from an expert on how everything works.)
Re:The fish shell is amazing by pxc on Thursday November 25, 2021 @12:22PM (#29343144)
> If your bash script has a shebang you shouldn’t need bass at all. Fish will read the shebang and just run your script with bash.

Shebangs are actually handled by the operating system kernel! I only know this because certain kinds of shebangs work on Linux, but not on other OSes

Re:The fish shell is amazing by dangus on Friday November 26, 2021 @07:38PM (#29355915)
That’s pretty neat information! I honestly barely know how all the pieces come together.
Re:The fish shell is amazing by pxc on Saturday November 27, 2021 @05:39PM (#29364307)
I was kind of hoping my comment would bait some OS person lurking on HN into really explaining interpreter directives, hahaha