Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old July 14th, 2002, 04:08 AM
Benahimvp's Avatar
Benahimvp Benahimvp is offline
The Basketball Star
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2001
Location: H-Town
Posts: 550 Benahimvp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via AIM to Benahimvp Send a message via Yahoo to Benahimvp
Running an executable

Is there anyway to run an executable without typing the full path when you're actually in its directory? I'm new to the whole UNIX world. The closest I've been to it was DOS. Since both look the same I thought both would act the same (bad idea). In DOS, if you're in the executable is in the directory you are in, you can just type "file.exe" and it'll run the file. That doesn't seem to be the case in UNIX if the path to the current directory isn't in the PATH environment variable. It took me an hour to figure out how to edit $PATH just so I could run an executable because I couldn't run it any other way it seemed. I hadn't yet realized to just use the whole path. Anyway, my question. If I'm in a specific "bin" directory, how do I just run the executable? Thanks.
__________________
-Ben Ilegbodu
(Around the Bend Web Designs)

Reply With Quote
  #2  
Old July 14th, 2002, 08:45 AM
Hero Zzyzzx's Avatar
Hero Zzyzzx Hero Zzyzzx is offline
11
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jul 2001
Location: Lynn, MA
Posts: 4,632 Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 23 h 12 m 33 sec
Reputation Power: 77
Send a message via AIM to Hero Zzyzzx
A side comment: This is a feature, not a bug.

Say you were browsing around shared directories, and someone dropped a malicious program called "ls" in the shared directory- DOS would stupidly execute it, doing whatever negative things the cracker wanted. Just another way *nix is a far better server environment than win32.

Anyway, assuming you want to execute a file in the current directory, you only have to make sure the file permissions are set correctly, and then prefix the filename with the current directory shortcut, ".".

So, you'd do
Code:
./file_to_execute.pl

to execute a file in the directory you're currently in.

This is a pretty basix *nix skill, you'd probably be well served to find and read a good basic *nix skills tutorial out there. . . .

Oh, and try hitting the "tab" key as you type out a file or path name- *nix has file/path autocomplete built in (at least in bash. . .)

Reply With Quote
  #3  
Old July 14th, 2002, 03:04 PM
Benahimvp's Avatar
Benahimvp Benahimvp is offline
The Basketball Star
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2001
Location: H-Town
Posts: 550 Benahimvp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via AIM to Benahimvp Send a message via Yahoo to Benahimvp
I never meant to make it seem that I thought it was a bug. I knew there was probably some reason. I have a UNIX book (that I haven't gotten all the way through), and I don't think it explained it. I might've just missed it. I've actually seen this notation lots of times, I just didn't know that's what it did. Thanks for the help and the TAB thing.

Reply With Quote
  #4  
Old July 14th, 2002, 09:48 PM
bnapier bnapier is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 1 bnapier User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
There was an article posted on Newsforge friday regarding a tutorial for unix newbies.. I read through it and it seemed like a great primer.

Here is the link:

URL

- Bryan

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > Running an executable


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate 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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway