So obviously not every system sets to /bin (such as )

If two systems have different install paths, say:

How can I write a shell script that allows both systems to be happy? can I do:
#!which bash
or something across these lines?

I really need to learn Bash properly sometime....

@MutoShack what about using something like #!/usr/bin/env bash ?



It's weird - GuixSD doesn't come with a /usr directory, it has a /gnu directory (I can add a /usr/env if I wanted to, but I want my software to be as out-of-the-box as possible, without the need for userside customization).

Thanks, though! /usr/bin/env, although not a catch-all in my case, is way more portable than the usual (and sadly ubiquitous) #!/bin/bash

@MutoShack well GuixSD adventures is a game that I hope to play soon

Sign in to participate in the conversation
Functional Café is an instance for people interested in functional programming and languages.