LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 03-12-2005, 10:10 PM   #1
Nalorin
Member
 
Registered: Mar 2005
Location: C-eh?-N-eh?-D-eh?
Distribution: 2.6.11-1.14_FC3
Posts: 58

Rep: Reputation: 15
Question How do I make it so I don't have to type './$filename' to run compiled C++ progs


Hey, all...

I'm just curious... I know that I have to do this in the /etc/bashrc file, but I don't know what I need to do exactly.
I tried to put in there:

alias $filename="./$filename"

but it didn't work - says './' is unrecognized... What I'm trying to do is have it so that I don't have to type in the . / before every binary file that I want to run, after compiling it from C++, for school

i.e.

process:

kwrite <filename>.cc &
#write code in C++ language
#save file

make <filename>
# then to execute the file
./<filename> #(without spaces)

#I want to type:
<filename> #(not 'dot-slash-<filename>')


can anyone help me in editing my /etc/bashrc file to do so, please

Last edited by Nalorin; 03-12-2005 at 10:11 PM.
 
Old 03-12-2005, 10:17 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 124Reputation: 124
Try this in your .bashrc:
Code:
PATH=$PATH:.
This will add your current working directory to your PATH (where the shell searches for executables). Placing it at the END is the preferred way to avoid bugs and security issues.
 
Old 03-12-2005, 11:12 PM   #3
Nalorin
Member
 
Registered: Mar 2005
Location: C-eh?-N-eh?-D-eh?
Distribution: 2.6.11-1.14_FC3
Posts: 58

Original Poster
Rep: Reputation: 15
ok, will do.... thx!

- If it doesn' t work: then, to quote Arnie - "I'll be back" :P
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Any progs to make keyboard buttons work? Jmcatch742 Linux - Software 1 12-30-2004 02:15 PM
filename;type=i newbie007007 Linux - Newbie 2 12-11-2004 01:03 PM
Mdk 10 - kde, other progs, slow on first run after boot Sparken Mandriva 6 05-01-2004 07:51 PM
Progs installed but dont run??? EyeSeven Mandriva 2 10-17-2003 06:27 AM
problem running progs compiled with g++ nautilus_1987 Linux - General 11 10-06-2002 02:16 PM


All times are GMT -5. The time now is 01:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration