On 2025-08-20 10:45, CAREY SCHUG via Talk wrote:
mainframe ignoramous here.

We can start a script with #!/bin/fish

or whatever it is called and use different shells for different scripts, right?
and call bash scripts from within the fish script as long as they start with #!/bin/bash ?

or am I missing something?

Seems like so much hate for something that can be kept on the sideline and used occasionally.  are there system variables or parameters that cannot be passed from bash to fish and back?

The unix rule is If the file is executable and has #! as the first 2 characters then it will execute the program on the rest of the line passing information to the executed program as the first parameter.


So if the file "/tmp/xxx.sh" has:
#! /bin/cat
hello world

The program cat will be executed as "cat xxx.sh"

Wikipedia explains it well in: https://en.wikipedia.org/wiki/Shebang_(Unix)
-- 
Alvin Starr                   ||   land:  (647)478-6285
Netvel Inc.                   ||   home:  (905)513-7688
alvin@netvel.net              ||