Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-22-2008, 08:01 AM
|
#1
|
|
LQ Newbie
Registered: Feb 2008
Posts: 3
Rep:
|
chmod: 1: Syntax error: "(" unexpected - what's this mean and how do I fix it?
Some background:
I' hacking a series 1 tivo. One of the things to do is create a file (rc.sysinit.author) and chmod it so it is executable. I am in the directory where the file is, and enter this:
/mnt7/bin/chmod: 755 rc.sysinit.author
and I get this error:
chmod: 1: Syntax error: "(" unexpected
I'm no dummy. I stared with a digicomp1 in the late 60's, passed through the ZXZ81-C64-cp/m-8088-8086-80286-etctera-etcetera, fiddle with pics, am completely comfortable with a command line, and so on. I am, however, new to Linux.
I have done quite a bit of googling to try to find what this error means, but have had no luck.
There is a possible hint in that the directions I'm following said to just enter:
chmod 755 rc.sysinit.author
but that gave me another error:
chmod: not found
which I could figure out how to fix, as above, by declaring the entire path in the command. Because of this, I have tried a number of variations on the chmod command - things like using +x instead of 755, including the whole filename with path for the rc.sysinit.author file, changing to the /mnt/bin directory and doing ./chmod 755 /the-whole-filepath-for-the-rc.sysyinit.author file. No luck.
I suppose I could edit the rc.sysinit file (runs first, then calls my file) which has the executable bit set but would rather know how to chmod.
|
|
|
|
02-22-2008, 08:45 AM
|
#2
|
|
LQ Newbie
Registered: Jan 2008
Distribution: OpenSuse 10.3, SLED 10 SP2, Ubuntu 8.04 and 9.04
Posts: 23
Rep:
|
Command 'chmod 755 myfile' should work if path is set so that it contains /mnt7/bin and you own the file. Traditionally directory bin is under root so '/bin/chmod 755 myfile'. Check path by typing 'path'.
|
|
|
|
02-22-2008, 08:46 AM
|
#3
|
|
Senior Member
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109
Rep:
|
Quote:
Originally Posted by SeriesOne
/mnt7/bin/chmod: 755 rc.sysinit.author
|
Shouldn't it be /mnt7/bin/chmod 755 rc.sysinit.author ?
Quote:
Originally Posted by SeriesOne
chmod 755 rc.sysinit.author
but that gave me another error:
chmod: not found
|
This means that chmod is not in your path.
Check your path with
Quote:
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
|
I am curious about the error you get from the first command, tho. You said you tried using other flags but did you try to run chmod on another file or directory than rc.sysinit.author? Cause otherwise it may be something odd with your chmod binary.
I have never worked on a Tivo before but if the rc.sysinit.author file is inside /mnt7 you could try to chroot into /mnt7 and try again.
|
|
|
|
02-22-2008, 09:05 AM
|
#4
|
|
LQ Newbie
Registered: Feb 2008
Posts: 3
Original Poster
Rep:
|
Quote:
Originally Posted by Ephracis
Shouldn't it be /mnt7/bin/chmod 755 rc.sysinit.author ?
Hmmm, this forum quoting thingy doesn't quote everything. I'm more used to usenet. I'm goint to preface you stuff with >
Yes, of course; there was no colon in the line I actually typed.
>This means that chmod is not in your path.
>Check your path with
echo $path gives a blank, which is why (I think) that typing the path + filename for chmod seemd to get chmod to work, instead of a not found error.
>I am curious about the error you get from the first command, tho. You >said you tried using other flags but did you try to run chmod on >another file or directory than rc.sysinit.author? Cause otherwise it >may be something odd with your chmod binary.
Just did that - made another file ("test") with the joe editor (looks exactly like VDE for cp/m) and
tried /mnt7/bin/chmod 755 test
- got the same error:
/mnt7/bin/chmod: 1: Syntax error: "(" unexpected
>I have never worked on a Tivo before but if the rc.sysinit.author file >is inside /mnt7 you could try to chroot into /mnt7 and try >again.
|
I don't seem to have a chroot command - went poking about in the directories but didn't find it. Just typing
chroot /mnt7
gives
chroot: not found.
|
|
|
|
02-22-2008, 09:56 AM
|
#5
|
|
Senior Member
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113
Rep: 
|
Try 'file /mnt7/bin/chmod' - I'm trying to figure out how you can get an error that has nothing to do with your command and all I can think of is that your chmod is a shell script, for some reason, with a syntax error in it or something.
I have no idea about a tivo, though. Why 'mnt7'? Why is your path not reasonable? Etc. I'd go ahead and set a path with all the usual '*bin's and whatever unusual places I could think of but, like I say, 'tivo?'
-- Oh yeah - I dunno what all you're up to, so this may not suffice but you can run a script that isn't executable by giving it as an argument to your shell - $SHELL rc.sysinit.author. So if you absolutely can't get it chmod'ed, you can still run it. But if things are that weird there'd be a lot more to fix than just running the file.
Last edited by slakmagik; 02-22-2008 at 10:01 AM.
Reason: late thought
|
|
|
|
02-22-2008, 01:18 PM
|
#6
|
|
LQ Newbie
Registered: Feb 2008
Posts: 3
Original Poster
Rep:
|
Quote:
Originally Posted by digiot
Try 'file /mnt7/bin/chmod' - I'm trying to figure out how you can get an error that has nothing to do with your command and all I can think of is that your chmod is a shell script, for some reason, with a syntax error in it or something.
I have no idea about a tivo, though. Why 'mnt7'? Why is your path not reasonable? Etc. I'd go ahead and set a path with all the usual '*bin's and whatever unusual places I could think of but, like I say, 'tivo?'
-- Oh yeah - I dunno what all you're up to, so this may not suffice but you can run a script that isn't executable by giving it as an argument to your shell - $SHELL rc.sysinit.author. So if you absolutely can't get it chmod'ed, you can still run it. But if things are that weird there'd be a lot more to fix than just running the file.
|
Well, I dunno about paths and shell scripts and so on...
One of the steps is to tell the tivo to start a telnet server when it boots. They advise you not to edit the rc.sysinit file as there is a lot of critical stuff there; but to edit the file that it supposedly looks for and hands off to if it exists - i.e. rc.sysinit.author.
I worked around it, sort of.
I copied the rc.sysinit file which has the correct permissions to re.sysinit.bak; then edited THAT file, then rm'd the rc.sysinit.author that could not be chmod'ed, then copied the rc.sysinit.bak to rc.sysinit.author.
LS -l shows all the correct permissions now.
Now I'm fighting with the ethernet adapter and trying to see if the telnet command (which is what in rc.sysinit.author) works. Sometimes my router gives the adapter an IP and sometimes not, and I have not yet seen a prompt over telnet. It's a pain not having a screen to look at what's going on in the box: take drive out, attach to extra pc, boot pc, edit file, put drive in tivo, boot tivo, wait and talk to router, try to telnet...; repeat ad inf.
Thanks all for replying.
|
|
|
|
02-22-2008, 01:18 PM
|
#7
|
|
Senior Member
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109
Rep:
|
Just to follow in the trail of digiot.. He may be on something about the chmod being a script.
Check if you can do something like
Quote:
|
$ /mnt7/bin/cat /mnt7/bin/chmod
|
Btw, it would help a lot if you told us the output of these commands:
Quote:
$ ls -l /
$ ls -l /mnt7
$ ls -l /mnt7/bin
|
As well as the content of the file called /etc/fstab (or /mnt7/etc/fstab, or something).
Also, are you following some guide on the internet when you are hacking on the Tivo? If so, it would be great if you posted a link to it.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:10 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|