BUG: no #! line in shell scripts created for menu commands



rpolzer katsuragi ~ $ mc -V
GNU Midnight Commander 4.6.0
Virtual File System: tarfs, extfs, cpiofs, ftpfs, fish, smbfs
With builtin Editor
Using system-installed S-Lang library with terminfo database
With subshell support as default
With support for background operations
With mouse support on xterm
With internationalization support
With multiple codepages support
rpolzer katsuragi ~ $ uname -a
FreeBSD katsuragi.durchnull.ath.cx 5.1-RELEASE-p10 FreeBSD 5.1-RELEASE-p10 #6: Mon Nov 10 16:54:07 CET 2003     root katsuragi durchnull ath cx:/usr/src/sys/i386/compile/DIV0_KERNEL  i386

I have lines like

p       add the files to playd (TEMP)
	playd put_end prepend %s

in my menu file. Now I noticed I get a "cannot execute binary file"
error message when the file name contains non-ASCII characters. Looking
at the temporary file named in the error message, I saw that the #! line
was missing. And really, adding a #!/bin/sh line worked:

p       add the files to playd (TEMP)
	#!/bin/sh
	playd put_end prepend %s

So what I first thought was that I misread the documentation. But even the
examples don't contain the shebang line. So I see two possible ways to fix
this bug:

a) document it and correct the examples
b) add a "correct" shebang line (#!$SHELL? #!/bin/sh? User-defined setting?)
   in these temporary files

Rudolf Polzer



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]