vcpkg-init.sh fail in /bin/sh with: /bin/sh: 85: /tmp/vcpkg-init.sh: Syntax error: Bad function name. It started recently, most probably after rename function to vcpkg-shell. Is - restricted for function name in sh shell?
If script is not intended to be run with just sh, should first line be updated?
Description
vcpkg-init.sh fail in /bin/sh with:
/bin/sh: 85: /tmp/vcpkg-init.sh: Syntax error: Bad function name
. It started recently, most probably after rename function tovcpkg-shell
. Is-
restricted for function name insh
shell? If script is not intended to be run with just sh, should first line be updated?Reproduction Steps
curl -L https://aka.ms/vcpkg-init.sh --output /tmp/vcpkg-init.sh \ && chmod a+x /tmp/vcpkg-init.sh \ && /bin/sh -c ". /tmp/vcpkg-init.sh" \
Expected behavior
Script runs without issues
Actual behavior
Script fails with /bin/sh: 85: /tmp/vcpkg-init.sh: Syntax error: Bad function name
Regression?
Yes, it worked on 2024-09-07, but was broken on 2024-09-14.
Known Workarounds
Run script using /bin/bash
Configuration
No response
Other information
No response