`head -l' is not supported on my version of head(1) on Debian buster nor bullseye (and AFAIK, not any version of head(1). Furthermore, head(1) is not required at all since sed(1) can limit operations to any line. Since this is a bash script, we'll also use "set -o pipefail" to ensure future errors of this type are caught. Signed-off-by: Eric Wong <e@xxxxxxxxx> --- make-debs.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/make-debs.sh b/make-debs.sh index 01d563c..136b79e 100755 --- a/make-debs.sh +++ b/make-debs.sh @@ -16,6 +16,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # set -xe +set -o pipefail # Create dir for build base=${1:-/tmp/release} @@ -38,7 +39,7 @@ cd ${releasedir}/${outfile} git clean -dxf # Change changelog if it's needed -cur_ver=`head -l debian/changelog | sed -n -e 's/.* (\(.*\)) .*/\1/p'` +cur_ver=$(sed -n -e '1s/.* (\(.*\)) .*/\1/p' debian/changelog) if [ "$cur_ver" != "$version-1" ]; then dch -D $codename --force-distribution -b -v "$version-1" "new version" fi