public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* bash shell script: recently running, now failing
@ 2023-04-06  4:43 Fergus Daly
  2023-04-06  8:03 ` Corinna Vinschen
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Fergus Daly @ 2023-04-06  4:43 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'; +Cc: Fergus Daly

I have a "hash bang" bash shell script i.e. first line
#! /bin/sh
or equivalently
#! /bin/bash
For various reasons I want this file to be identified as binary so its second line
is the single character null \x00 showing up in some editors e.g. nano as
 ^@
This does not prevent the script from running to a successful conclusion.
Or not until recently. Now the script fails with
/home/user/bin/file.old.sh: cannot execute binary file
Q1 - was bash recently updated? Would this explain the changed behaviour?
Q2 - if so, is this newly introduced "glitch" known and presumably intended? Or
an unintended consequence that will be retracted in a later update? 
I then altered the first line to
#! /bin/dash
whilst retaining the null character at line 2 and subsequent content also unaltered..
The altered script file.new.sh runs as previously to a successful conclusion.
Q3 - at 1/8 the size of bash and sh, I am not at all sure of the role and reach of dash.
Should the edit (dash replacing bash/sh) be incorporated elsewhere or would this be a
bad idea (and retained only locally in what is indeed an eccentric and one-off context)?


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-04-08  8:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-06  4:43 bash shell script: recently running, now failing Fergus Daly
2023-04-06  8:03 ` Corinna Vinschen
2023-04-06 12:23   ` Scott Smith
2023-04-06 12:21 ` Andrey Repin
2023-04-07 19:34   ` Brian Inglis
2023-04-08  8:37     ` Andrey Repin
2023-04-06 17:18 ` Adam Dinwoodie
2023-04-06 19:26   ` Scott Smith

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).