unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: jordi <jordila@librebits.info>
To: help-guix@gnu.org
Subject: Re: bash scripts in Guix question - suspend ?
Date: Wed, 5 Oct 2022 11:48:42 +0200	[thread overview]
Message-ID: <Yz1S+mCb95p+ytXW@mercurio> (raw)
In-Reply-To: <877d1eapma.fsf@laura>


Thank you all for your warm welcome and answers to my questions.

I'm trying to adapt this script
[..]
	Suspend)
		~/.config/i3/i3exit suspend
[..]

 to my new Guix environment,

in my first iteration,

[..]
	Suspend)
		~/.config/i3/i3exit loginctl suspend
[..]


replacing prepending loginctl leads to unsuccesful results, for now.

I'm puzzled, as long as   'loginctl suspend' is working in the shell ,

What am i missing ?

Thanks, thanks, thanks


On 2022-10-04 23:58:05, Olivier Dion via wrote:
> On Tue, 04 Oct 2022, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:
> > Hi,
> >
> > Olivier Dion via <help-guix@gnu.org> writes:
> >
> >> 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:
> >>
> >> #!/bin/sh
> >> if [ "$(basename $SHELL)" != "bash" ]; then
> >>   exec bash "$0" "$@"
> >> fi
> >>
> >> echo "hey!"
> >
> > I prefer the "#!/usr/bin/env bash" shebang; /usr/bin/env is available on
> > FHS distribution, and on Guix System, for convenience.  You can use if
> > for any interpreted script, such as Guile, Python, Perl, etc.
> 
> Only if coreutils is in the profile that would work yes.
> 
> -- 
> Olivier Dion
> oldiob.dev
> 


  reply	other threads:[~2022-10-05  9:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-04 13:18 bash scripts in Guix question jordi
2022-10-04 14:10 ` Ekaitz Zarraga
2022-10-04 14:31 ` Fulbert
2022-10-04 14:38 ` Olivier Dion via
2022-10-05  3:38   ` Maxim Cournoyer
2022-10-05  3:58     ` Olivier Dion via
2022-10-05  9:48       ` jordi [this message]
2022-10-05 10:29         ` bash scripts in Guix question - suspend ? Tobias Geerinckx-Rice
2022-10-06  0:43       ` bash scripts in Guix question Maxim Cournoyer
2022-10-06  0:56         ` Olivier Dion via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yz1S+mCb95p+ytXW@mercurio \
    --to=jordila@librebits.info \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).