2024-04-18 05:49 BST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002653Buildsystem[All Projects] Generalpublic2019-08-01 11:07
ReporterMichael Siegel 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformLinuxOSDevuanOS Version2.0.0/ASCII
Summary0002653: env.sh: Function names including hyphens cause syntax error in dash
DescriptionAs the shebang (#!/bin/sh) implies, the env.sh script is supposed to work in POSIX shells – or at least in dash, as I've been told on IRC.

However, POSIX doesn't allow for function names to contain hyphens, and neither does dash, at least not up until version 0.5.8, which is the one in Debian's current stable release.

So, these functions should better be named using underscores instead of hyphens.
Steps To Reproduce$ dash
$ ns-apt-get-install() { echo "would do stuff"; }
dash: 1: Syntax error: Bad function name
$ ns_apt_get_install() { echo "would do stuff"; }
$ ns_apt_get_install
would do stuff
$
TagsNo tags attached.
Fixed in CI build #
Reported in CI build #
Attached Files

-Relationships
+Relationships

-Notes
Daniel Silverstone

~0002041

Daniel Silverstone (administrator)

This is a fragment intended to be sourced into an interactive `bash` or `zsh` not `dash`. As such I've removed the shebang and added a comment to that effect.
+Notes

-Issue History
Date Modified Username Field Change
2019-05-18 18:27 Michael Siegel New Issue
2019-08-01 11:07 Daniel Silverstone Status new => closed
2019-08-01 11:07 Daniel Silverstone Resolution open => no change required
2019-08-01 11:07 Daniel Silverstone Note Added: 0002041
+Issue History