View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 8 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Tue Nov 15, 2005 7:04 pm 
Offline
Joined: Wed Oct 26, 2005 4:54 pm
Posts: 98
ok. i have a directvbox with a serial input on the back (tht maked is SO much easyier!)
so i reinstall this weekend because something got realy fuxxored up (my "all knowing, linux loving cousin" screwd something up, and he dosent know enough about what he did to tell me, so i can fix it. anyhoo, i reinstalled.

now i need to get the script
so this is what i did
su
cd /root/
wget http://www.pdp8.net/directv/directv.pl
chmod a+x directv.pl


that should make the script executable right???
and there were no erors useing wget
so now i should just be able to do
directv.pl
that will list all the commands that it will work with.
but instead i get
bash: dirrectv.pl command not found.

and just to make shure i did it right, i
cd /root/
dir
directv.pl [some other files, but i cant rember]

so its there, and it should be working. i know that all that i needed 2 do last time

so what gives?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 8:10 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
Try:
Code:
./directv.pl
I'm not even going to try to explain why tonight... ;-)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 9:14 pm 
Offline
Joined: Fri Sep 19, 2003 7:05 pm
Posts: 5088
Location: Fontana, Ca
You should move that to /usr/local/bin. You should also try to avoid getting things as root.

_________________
cesman

When the source is open, the possibilities are endless!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 9:24 pm 
Offline
Joined: Wed Oct 26, 2005 4:54 pm
Posts: 98
tjc wrote:
Try:
Code:
./directv.pl
I'm not even going to try to explain why tonight... ;-)


thats ok, i have had many questions, and i just wana say thanks for answering them.

its ppl like oyu that help noobs like me out, making this form a better one and encouraging more and more ppl to use this great piece of software.

and, maby not 2 night,but a simple explination would help, as i will a) not ask that question, b) expand my knowedge c) if another person in need of that knowedge wonders by this post then they will know, without having 2 repost/ask annoying ?'s


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 9:42 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
What Cecil said is true too. Once you've tested it, move the file to /usr/local/bin and make sure it has the right ownership and permissions as follows:
Code:
cp directv.pl /usr/local/bin
chown root:root /usr/local/bin/directv.pl
chmod u=rwx,go=rx /usr/local/bin/directv.pl

When you go back into mythtv-setup and tell it to use the script to control your external tuner, remember to use the full path name: /usr/local/bin/directv.pl


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 10:52 pm 
Offline
Joined: Mon Oct 06, 2003 10:38 am
Posts: 4978
Location: Nashville, TN
and the explanation of the ./scriptname.type

basically you are running the script using a relative path. You can always run a script (if it's marked executable) using the full path /path/to/my/script.type, but if you are in the directory with the script to save some typing you can run ./script.type if you notice when you run an ls you see . and ..

. means this dir and .. means one directory up in the tree, so ./filename runs the file from this directory you can also use the .. for instance if you are in /home/mythtv/somedir you can type ../filename and it will run /home/mythtv/filename

and now you see why tjc didn't want to try to explain it, and I'm certainly not doing it any justice.

_________________
Have a question search the forum and have a look at the KnoppMythWiki.

Xsecrets


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 11:03 pm 
Offline
Joined: Wed Oct 26, 2005 4:54 pm
Posts: 98
Xsecrets wrote:
and the explanation of the ./scriptname.type

basically you are running the script using a relative path. You can always run a script (if it's marked executable) using the full path /path/to/my/script.type, but if you are in the directory with the script to save some typing you can run ./script.type if you notice when you run an ls you see . and ..

. means this dir and .. means one directory up in the tree, so ./filename runs the file from this directory you can also use the .. for instance if you are in /home/mythtv/somedir you can type ../filename and it will run /home/mythtv/filename

and now you see why tjc didn't want to try to explain it, and I'm certainly not doing it any justice.


i do hwever aprechiate you taking the time to xplain. tx


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 16, 2005 12:01 am 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
Well it's already tomorrow here now, so maybe I'll take a crack at explaining it... ;-)

When you execute a command in Unix/Linux there are two ways for the system to find it:

1) You provide an absolute or relative file name for the command which points directly to it. For example "/usr/local/bin/directv.pl" or "./directv.pl", the first one is fully specified from the root of the directory tree, the second one is relative to the current directory.

2) You provide a unqualified name which the system looks up by searching through the directories listed in your "PATH" variable. For example "nano" which is actually:
Code:
root@black2:~# type nano
nano is /bin/nano
root@black2:~# echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin:/usr/games
root@black2:~# for p in $(echo $PATH | sed '/:/s// /g'); do ls -l $p/nano ; done
ls: /sbin/nano: No such file or directory
-rwxr-xr-x  1 root root 113880 Jan 18  2005 /bin/nano
ls: /usr/sbin/nano: No such file or directory
lrwxrwxrwx  1 root root 9 Nov  6 18:07 /usr/bin/nano -> /bin/nano
ls: /usr/X11R6/bin/nano: No such file or directory
ls: /usr/local/sbin/nano: No such file or directory
ls: /usr/local/bin/nano: No such file or directory
ls: /usr/games/nano: No such file or directory

Here you can see, where the system will find nano, the setting of your PATH, and whether or not the file (or a proxy for it) exists in all the possible locations. Notice that while nano is available from two different locations here ("/bin" and "/usr/bin") the first one the system actually finds while searching your PATH is used.

This may bring up the question of why "." (aka - current directory) is not included in your PATH. The main reason, is that it would be VERY VERY dangerous, to the point of sheer lunacy, especially for root. Let's say you've got some bozo loose on your system who likes to do the evil 777 thing (Yes, in my world 777 is the number of the beast). and as a result they've made everything in sight executable. Now you're suddenly in a minefield where any finger flub, bad tab completion, or even attempting to use a common but locally "unavailable" command may lead to executing some arbitrary file in the current directory... I don't know about you, but just thinking about the potential consequences makes me break out in a cold sweat...


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu