oygle
January 14th, 2009, 02:27 PM
I'm trying to run a bash script to install a LAN driver for an ASUS mobo. I run the script, and get this error
./install.sh: 59: Syntax error: "(" unexpected
Here are the first 60 lines of the script, lines 1 to 58 are all comments, and line 59 is a function
#!/bin/sh
################################################## #############################
# Part of Marvell Yukon/SysKonnect sk98lin Driver for Linux #
################################################## #############################
# Installation script for Marvell Chip based Ethernet Gigabit Cards #
# $Revision: 1.28 $ #
# $Date: 2004/06/11 12:25:47 $ #
# ================================================== ========================= #
# #
# Main - Global function #
# #
# Description: #
# This file includes all functions and parts of the script #
# #
# Returns: #
# N/A #
# ================================================== ========================= #
# Usage: #
# ./install.sh #
# #
# ================================================== ========================= #
# COPYRIGHT NOTICE : #
# #
# (C)Copyright 2003-2004 Marvell(R). #
# #
# This program is free software; you can redistribute it #
# and/or modify it under the terms of the GNU General Public #
# License as published by the Free Software Foundation; either #
# version 2 of the License, or (at your option) any later version. #
# #
# #
# WARRANTY DISCLAIMER: #
# #
# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT #
# ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR #
# FITNESS FOR A PARTICULAR PURPOSE. #
# #
# ================================================== ========================= #
# #
# History: #
# 2004-04-26 Version 2.02 - New parameter configuration (mlindner) #
# 2004-04-26 Version 2.01 - Support for Intel x86_64 arch (mlindner) #
# 2004-02-15 Version 2.00 - Support for yukon2 chipsets (mlindner) #
# Support for kernel 2.6 #
# Support for parallel make on SMP-Hosts #
# Make a patch against the current kernel #
# Added help option. #
# More command line parameters for auto inst.#
# Better SMP detection #
# Highmem detection #
# #
# #
################################################## #############################
# Functions
###########################################
function message_status ()
{
Now I don't know much about bash scripts, but surely hitting a function before it is 'called' is maybe why it fell over ??
I see right down the bottom of the script is this
# Start
################################################## ###################
drv_name=`echo sk98lin`
#drv_name=`echo sk98lin`
working_dir=`pwd`
logfile="$working_dir/install.log"
rm -rf $logfile &> /dev/null
trap cleanup_trap INT TERM
KERNEL_TREE_MAKE=0;
VERSION="2.02 (20040608)"
clear
# Run main function
main_global $*
# Exit
exit 0
The 'start' is at the end, and the function 'main_global' is contained in the rest of the code.
Obviously I need to tell bash/sh to not execute those functions at the start, and drop down to the very end of the code,... where it all starts.
Oygle
./install.sh: 59: Syntax error: "(" unexpected
Here are the first 60 lines of the script, lines 1 to 58 are all comments, and line 59 is a function
#!/bin/sh
################################################## #############################
# Part of Marvell Yukon/SysKonnect sk98lin Driver for Linux #
################################################## #############################
# Installation script for Marvell Chip based Ethernet Gigabit Cards #
# $Revision: 1.28 $ #
# $Date: 2004/06/11 12:25:47 $ #
# ================================================== ========================= #
# #
# Main - Global function #
# #
# Description: #
# This file includes all functions and parts of the script #
# #
# Returns: #
# N/A #
# ================================================== ========================= #
# Usage: #
# ./install.sh #
# #
# ================================================== ========================= #
# COPYRIGHT NOTICE : #
# #
# (C)Copyright 2003-2004 Marvell(R). #
# #
# This program is free software; you can redistribute it #
# and/or modify it under the terms of the GNU General Public #
# License as published by the Free Software Foundation; either #
# version 2 of the License, or (at your option) any later version. #
# #
# #
# WARRANTY DISCLAIMER: #
# #
# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT #
# ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR #
# FITNESS FOR A PARTICULAR PURPOSE. #
# #
# ================================================== ========================= #
# #
# History: #
# 2004-04-26 Version 2.02 - New parameter configuration (mlindner) #
# 2004-04-26 Version 2.01 - Support for Intel x86_64 arch (mlindner) #
# 2004-02-15 Version 2.00 - Support for yukon2 chipsets (mlindner) #
# Support for kernel 2.6 #
# Support for parallel make on SMP-Hosts #
# Make a patch against the current kernel #
# Added help option. #
# More command line parameters for auto inst.#
# Better SMP detection #
# Highmem detection #
# #
# #
################################################## #############################
# Functions
###########################################
function message_status ()
{
Now I don't know much about bash scripts, but surely hitting a function before it is 'called' is maybe why it fell over ??
I see right down the bottom of the script is this
# Start
################################################## ###################
drv_name=`echo sk98lin`
#drv_name=`echo sk98lin`
working_dir=`pwd`
logfile="$working_dir/install.log"
rm -rf $logfile &> /dev/null
trap cleanup_trap INT TERM
KERNEL_TREE_MAKE=0;
VERSION="2.02 (20040608)"
clear
# Run main function
main_global $*
# Exit
exit 0
The 'start' is at the end, and the function 'main_global' is contained in the rest of the code.
Obviously I need to tell bash/sh to not execute those functions at the start, and drop down to the very end of the code,... where it all starts.
Oygle