Shell Script Fails:syntax Error: "(" unexpected
Google a bit.
http://unix.stackexchange.com/questions/45781/shell-script-fails-syntax-error-unexpected
The script does not begin with a shebang line, so the kernel executes it with /bin/sh
. On Ubuntu, was /bin/sh
Dash, a shell designed for fast startup and execution with only standard features. When the dash reaches line is, it sees a syntax error:that parenthesis doesn ' t mean anything to it in context.
Since Dash (like all other shells) is a interpreter, it won ' t complain until the execution reaches the problematic line. So even if the script successfully started at some point in your testing, it would has aborted once line is reached.
The shebang line must is the very first thing in the file. Since You use bash features, the first line of the file must is #!/bin/bash
or #!/usr/bin/env bash
.
is to change the first line #!/bin/bash
or#!/usr/bin/env bash
Shell Script Fails:syntax Error: "(" unexpected