Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-12-2005, 11:10 PM   #1
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



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 11:11 PM.
Old 03-12-2005, 11:17 PM   #2
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Try this in your .bashrc:
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-13-2005, 12:12 AM   #3
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


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 03:15 PM
filename;type=i newbie007007 Linux - Newbie 2 12-11-2004 02:03 PM
Mdk 10 - kde, other progs, slow on first run after boot Sparken Mandriva 6 05-01-2004 08:51 PM
Progs installed but dont run??? EyeSeven Mandriva 2 10-17-2003 07:27 AM
problem running progs compiled with g++ nautilus_1987 Linux - General 11 10-06-2002 03:16 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:58 PM.

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