test_all: POSIX head/tail invocations

* head -number is not allowed by POSIX.1-2024:
  https://pubs.opengroup.org/onlinepubs/9799919799/utilities/head.html
  https://devmanual.gentoo.org/tools-reference/head-and-tail/index.html
This commit is contained in:
David Seifert 2024-11-16 19:03:02 +01:00 committed by Nick Craig-Wood
parent 0214a59a8c
commit acd5a893e2
3 changed files with 5 additions and 5 deletions

View File

@ -7,11 +7,11 @@ for backend in $( find backend -maxdepth 1 -type d ); do
continue continue
fi fi
commit=$(git log --oneline -- $backend | tail -1 | cut -d' ' -f1) commit=$(git log --oneline -- $backend | tail -n 1 | cut -d' ' -f1)
if [ "$commit" == "" ]; then if [ "$commit" == "" ]; then
commit=$(git log --oneline -- backend/$backend | tail -1 | cut -d' ' -f1) commit=$(git log --oneline -- backend/$backend | tail -n 1 | cut -d' ' -f1)
fi fi
version=$(git tag --contains $commit | grep ^v | sort -n | head -1) version=$(git tag --contains $commit | grep ^v | sort -n | head -n 1)
echo $backend $version echo $backend $version
sed -i~ "4i versionIntroduced: \"$version\"" docs/content/${backend}.md sed -i~ "4i versionIntroduced: \"$version\"" docs/content/${backend}.md
done done

View File

@ -13,7 +13,7 @@ if [ "$1" == "" ]; then
exit 1 exit 1
fi fi
VERSION="$1" VERSION="$1"
ANCHOR=$(grep '^## v' docs/content/changelog.md | head -1 | sed 's/^## //; s/[^A-Za-z0-9-]/-/g; s/--*/-/g') ANCHOR=$(grep '^## v' docs/content/changelog.md | head -n 1 | sed 's/^## //; s/[^A-Za-z0-9-]/-/g; s/--*/-/g')
cat > "/tmp/${VERSION}-release-notes" <<EOF cat > "/tmp/${VERSION}-release-notes" <<EOF
This is the ${VERSION} release of rclone. This is the ${VERSION} release of rclone.

View File

@ -18,5 +18,5 @@ status() {
} }
docker_ip() { docker_ip() {
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{"\n"}}{{end}}' "$NAME" | head -1 docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{"\n"}}{{end}}' "$NAME" | head -n 1
} }