Fedora Linux Support Community & Resources Center
  #1  
Old 19th December 2005, 05:02 PM
code_astronomer Offline
Registered User
 
Join Date: Dec 2005
Location: England
Posts: 470
Script not running due to syntax error - please help

Hi,

I dont know which section to post this in, so I posted it in programming seeing as its scripting related.

Im trying to install the atmel driver for my BT Voyager 1010 USB Adapter. I have had a lot of problems with this, but have finally managed to get a cvs version that will compile. The only problem is, I get an error in this script. I have never done any of this sh stuff, so I cant fix it.

Does anyone know why I get the syntax message? (See output after running the script below)

#----THIS IS THE ACTUAL SCRIPT----
#!/bin/bash
PATCHDIR=patch
WIRELESS=/etc/pcmcia/wireless.opts
atmel='grep -c 'ATMEL' $WIRELESS'
# if [ "$atmel" -lt "1" ]; then patch $WIRELESS $PATCHDIR/startup.patch; fi
if [ -f scripts/.vnetrc ]; then install -m 666 scripts/.vnetrc /root/; fi
if [ -f scripts/atmel.conf ]; then install -m 666 scripts/atmel.conf /etc/pcmcia/; fi
for i in objs/usb*.o ; do #<---------- this line errors
cuted_i=$(basename $i|cut -d. -f1)
if [ -f $i ];then if ( grep $cuted_i /etc/modules.conf >/dev/null ); then
echo "NOP" >/dev/null; else
echo "#post-install $cuted_i /bin/fastvnet.sh">> /etc/modules.conf;fi
fi
done
#----END OF SCRIPT ----


The output of this is: (I have run something before so I think thats why the directories already exist)


[root@localhost atmelwlandriver]# make install
pcmcia directory already exists
usb directory already exists
pci directory already exists
bin directory already exists
x11r6 bin directory already exists
/home/<User>/Desktop/atmelwlandriver/scripts/append.sh: line 8: syntax error near 'nexpected token `do
/home/<User>/Desktop/atmelwlandriver/scripts/append.sh: line 8: `for i in objs/usb '.o ; do
make: *** [install] Error 2
[root@localhost atmelwlandriver]#
Reply With Quote
  #2  
Old 19th December 2005, 05:37 PM
Zigzagcom Offline
Registered User
 
Join Date: Feb 2005
Location: CALIFORNIA, yeah
Age: 87
Posts: 1,657
atmel='grep -c 'ATMEL' $WIRELESS'

Not sure, just started learning about this stuff, but what about the single quotes within single quotes?
__________________
Ziggy
Reply With Quote
  #3  
Old 19th December 2005, 05:41 PM
code_astronomer Offline
Registered User
 
Join Date: Dec 2005
Location: England
Posts: 470
Yeah, I thought that was weird, but it errors on line 8 (for i in objs/usb*.o ; do #<---------- this line errors)
Its rather confusing. I wondered about the semi-colon, but it doesnt make a difference if I remove it.

Its very annoying, because this is the closest I have got to actually installing this driver after 5 days of compiling and downloading (with which, each time, I have to log out and boot windoze)
Reply With Quote
  #4  
Old 19th December 2005, 05:49 PM
Zigzagcom Offline
Registered User
 
Join Date: Feb 2005
Location: CALIFORNIA, yeah
Age: 87
Posts: 1,657
As I understand it, a syntax error in the code will not neccessarily spew out the right error messages, i.e., the error message may point to a line, but the error might have occurred earlier in the script.
__________________
Ziggy
Reply With Quote
  #5  
Old 19th December 2005, 05:51 PM
code_astronomer Offline
Registered User
 
Join Date: Dec 2005
Location: England
Posts: 470
oh. so do you think the line:
atmel='grep -c 'ATMEL' $WIRELESS'

should be

atmel='grep -c ATMEL $WIRELESS'

? Im not sure what that actually does to be honest.
Reply With Quote
  #6  
Old 19th December 2005, 05:55 PM
code_astronomer Offline
Registered User
 
Join Date: Dec 2005
Location: England
Posts: 470
I just found another version of the script, which has the following line:
atmel=`grep -c 'ATMEL' $WIRELESS`

(notice the ` at the beginning and the end are different to the 'Atmel' quotes)...is this valid??

actually, I think I edited them because the script didnt run before. :S
Reply With Quote
  #7  
Old 19th December 2005, 05:56 PM
Zigzagcom Offline
Registered User
 
Join Date: Feb 2005
Location: CALIFORNIA, yeah
Age: 87
Posts: 1,657
All I know is that in certain cases you need to start out with double quotes, then quote the item within with single quotes. I was just looking...as I said, I'm a newb at this as well...consider it a stab in the dark.
__________________
Ziggy
Reply With Quote
  #8  
Old 19th December 2005, 05:57 PM
Zigzagcom Offline
Registered User
 
Join Date: Feb 2005
Location: CALIFORNIA, yeah
Age: 87
Posts: 1,657
That could be it, the backticks have certain meaning...try it.
__________________
Ziggy
Reply With Quote
  #9  
Old 19th December 2005, 06:39 PM
code_astronomer Offline
Registered User
 
Join Date: Dec 2005
Location: England
Posts: 470
I dont think its the script thats the problem.
I tried: make usb buildonly=release as a command to build the 'atmelwlandriver' cvs source and it spews out a load of errors. I must have not done that before.

Can anyone help me in that department? Im using the cvs that is recommended for kernel version 2.6.x from http://atmelwlandriver.sourceforge.net
Reply With Quote
Reply

Tags
error, running, script, syntax

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Yum + Python syntax error DarkMasterHalo Using Fedora 10 12th September 2008 02:46 PM
Writing your own rc.d script - some syntax questions akvino Using Fedora 1 9th August 2007 09:37 PM
Parse error: syntax error, unexpected T_STRING in /home/wwwroot/phpMyAdmin-2.6.2/libr marco75 Servers & Networking 0 18th December 2006 02:35 AM
Httpd Syntax error mrman2787 Servers & Networking 4 18th August 2005 10:10 PM


Current GMT-time: 18:01 (Thursday, 21-08-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat