指向脚本时报错: ./install-oatpp-modules.sh: 17: Syntax error: “(“ unexpected

报错:

./install-oatpp-modules.sh: 17: Syntax error: “(” unexpected

解决办法

#!/bin/sh

改为

#!/bin/bash

#!/bin/bash

改为

#!/bin/sh

报错原因

The function keyword is supported in many modern shells, including Bash, which is an extended version of the Bourne Shell. If your script is intended to be executed with Bash, you can change the shebang (the first line of your script) to use Bash explicitly.

你可能感兴趣的:(Linux,linux)