[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash scripts in Guix question
From: |
Olivier Dion |
Subject: |
Re: bash scripts in Guix question |
Date: |
Tue, 04 Oct 2022 10:38:23 -0400 |
On Tue, 04 Oct 2022, jordi <jordila@librebits.info> wrote:
> Hi guixers,
>
> i'm wondering...for my scripts to work in Guix, instead of
> '#! /bin/bash' ,
>
Typically the `sh' program should be a symlinked to `bash' in your
system profile. I think it is the case for many distro. If you want it
to be bulletproof though for other distros maybe something like that:
--8<---------------cut here---------------start------------->8---
#!/bin/sh
if [ "$(basename $SHELL)" != "bash" ]; then
exec bash "$0" "$@"
fi
echo "hey!"
--8<---------------cut here---------------end--------------->8---
--
Olivier Dion
oldiob.dev