[CentOS] Syntax Help on a Bash Script
bobster58 at gmail.com
Wed May 4 04:33:52 UTC 2011
I'm brand new at doing anything linux and would like feedback on this
script I'm trying to understand from an example I'm working on..
Oh, running Centos 5.6
Anyhow, I run this bash script:
# send data to the table in the MySQL database
if [ $# -ne 4 ]
echo "Usage: mtest4 empid lastname firstname salary"
statement="insert into employees values ($1, '$2','$3', $4)"
$MYSQL test << EOF
If [ $? -eq 0 ]
echo "Data successfully added"
echo "Problem adding data"
and here is the error I get:
[Bobster at localhost ~]$ ./mtest4 5 Johnson John 120000
./mtest4: line 15: syntax error near unexpected token `then'
./mtest4: line 15: ` then'
Thanks in advance for any inputs.
More information about the CentOS