# Help with Linux syntax



## SJBrooks (Apr 24, 2004)

As they chant at football ground "You dont know what your doing"

That's me that is.

First attempt to install and run a hack isn;t working.

Please help!

Trying to install: Sort Now Playing in TiVo GUI

Using FileZilla I have FTP'd all the reqd files to the reqd directories.

I make the telnet session ok and get to the directory and this is what it says:

"Bash /var/hack #"

I have then typed:
% ./fixmwstate.tcl 
with no space between the 
#
and the
%

I have tried it with a space

I have tried it without the 
%

No joy

Everytime I get

No such file or directory!!!

I have checked they are there with FileZIlla and run a refresh and they seem to be there!!

Help!!!!!!!!!!!!!!!


----------



## Raisltin Majere (Mar 13, 2004)

Did you transfer in binary mode?


----------



## SJBrooks (Apr 24, 2004)

Good suggestion.

Set FileZilla to transfer in binary mode.

Copied over old files.

Made no difference 

Same symptoms.


----------



## T1V0 (Jun 14, 2006)

the file needs to be executable and to have unix line endings to interpret the #!/tvbin/tivosh pound bang at the beginning of the file. you can avoid this by calling the script directly with tivosh, ie : tivosh fixmwstate.tcl

IME tivosh doesn't seem to mind file permissions or dos line endings. or you can run the file thru dos2unix if you have that on your tivo, and then make it executable with chmod 755 fixmwstate.tcl - the &#37; is not required.


----------



## SJBrooks (Apr 24, 2004)

Thanks for everyones help so far.

Well with tivosh used I get:

invalid command name "mount"
while executing
"mount -0 remount -rw /"
( file "fixmwstate.tcl" line 7)

So is the program now running and the failure is with the program or the rights/permissions??

Thanks again,
Simon


----------



## blindlemon (May 12, 2002)

Hi Simon, 

You shouldn't need to use tivosh, but if you do then you may need to remove the mount command.

Why not just use the Windows command line FTP in binary mode and transfer the file again properly. Then make it executable from the bash prompt and run it:-

cd /var/hack
chmod 755 fixmwstate.tcl
./fixmwstate.tcl


----------



## SJBrooks (Apr 24, 2004)

The reason I havent used FTP from a cmd prompt is I am useless at FTP 

I dont expect hand holding, but is the a good reference guide on the web for FTP?

Thanks,
SImon


----------



## blindlemon (May 12, 2002)

The Windows command line FTP is dead easy. That's all I use.

Open a command window on your PC and change to the directory where the files you want to send are located. Assuming your TiVo is on 192.168.1.200 type

*ftp -i 192.168.1.200*

then at the user prompt hit Enter.

type

*bin*

to change to Binary mode then

cd /var/hack

to set the target diretcory. Then type

*mput *.**

to transfer everything from your source directory on the PC to /var/hack

Finally, type

*quit*

to exit FTP.


----------



## SJBrooks (Apr 24, 2004)

That was hand holding, but is appreciated. Thanks


----------



## SJBrooks (Apr 24, 2004)

Thanks Blindlemon (again!)

Well your FTP tips seemed to do the trick. I compared the file sizes on my PC and the Tivo and they seemed the same.

Next I ran, from :

Bash /var/hack #

cd /var/hack
chmod 755 fixmwstate.tcl
./fixmwstate.tcl

the cmdmod resulted in being reprompted with:
Bash /var/hack #
and then another:
Bash /var/hack #
to which I typed:
./fixmwstate.tcl
Which resulted in:
bash: ./fixmwstate.tcl No such file or directory

I then used the ls -R command and found fixmwstate.tcl

I am confused


----------



## blindlemon (May 12, 2002)

What do you get if you type 

cat fixmwstate.tcl


----------



## SJBrooks (Apr 24, 2004)

I got:

#!/bin/bash
#
# Fix the MWSTATE bug on 2.5.5 Uk Thompson Tivos
mount -0 remount -rw /
cd /tvbin
mw tivoapp tivoapp-bak
cp tivoapp-bak tivoapp
echo -n '1' | dd conv=notrunc of=tivoapp bs=1 seek=5137975
echo ""
echo "MWSTATE bug fixed successfully"
echo ""
echo "Please restart tivo for this to take effect"
echo ""
echo "e.g. type reboot (enter) at the prompt"
Bash /var/hack #
Bash /var/hack #exit


----------



## SJBrooks (Apr 24, 2004)

Does this mean it has now run successfully?

I understand the CAT cmd:
reads each File parameter in sequence and writes it to standard output.

Isnt that the way a program should run by default?


----------



## Pete77 (Aug 1, 2006)

blindlemon said:


> The Windows command line FTP is dead easy. That's all I use


To you may be but to the rest of us not so.

Filezilla is much easier to use and always works fine so long as the transfers are done in Binary mode.

I think you must just enjoy any chance you can get to revert to a black screen and the old dos command line interface.


----------



## T1V0 (Jun 14, 2006)

SJBrooks said:


> I got:
> 
> #!/bin/bash
> #
> ...


a shell script with a .tcl extension?

just type the lines from that script one at a time except for the ones starting with # or echo. ('mw' should be 'mv'). also, do *mount -o remount,ro /* before you reboot.


----------

