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

If two systems have different install paths, say:
System1:
/home/me/bin/bash
System2:
/bin/bash

How can I write a shell script that allows both systems to be happy? can I do:
#!$BASH
#!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 ?

Follow

@constrict0r

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

Ā· Web Ā· 1 Ā· 0 Ā· 0

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

Sign in to participate in the conversation
Functional CafƩ

functional.cafe is an instance for people interested in functional programming and languages.