All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Bilbrey <bilbrey@orbdesigns.com>
To: "Sridhar J (june end)" <sridharj.hyd@cxknetworks.com>,
	linux-newbie@vger.kernel.org
Subject: Re: Reg:gcc
Date: Wed, 26 Jun 2002 06:45:29 -0700	[thread overview]
Message-ID: <200206260645.29872.bilbrey@orbdesigns.com> (raw)
In-Reply-To: <F4D3DB9A18752A4F99FD880ABC5407179D15BA@ccdc-exchg.careercommunity.com>

On Wednesday 26 June 2002 05:26, Sridhar J (june end) wrote:
> Doesn't it mean that a.out is in the current directory? So why I should go
> to a parent directory as in ./a.out to execute it?

Sorry, you're not understanding a couple of things. First, "./" is the 
*current* directory, not the parent directory (which would be "../").

Second thing. To run a program in Linux, either the program needs to be on 
your PATH (type echo $PATH to see) or you need to specify the path to the 
executable. To run a program that you've compiled in the current directory, 
when said directory is not in your PATH, then ./filename is shorthand for 
"run the executable file "filename" that's right here in this directory"

Now, sometimes the obvious idea leaps into people's heads... "Why not make my 
home directory on my PATH, so that I can just execute files by name when I  
compile them". Resist the temptation. Executing programs should be explicit 
and thought about. What I did was to make a directory called bin in my home 
directory, and put that on my path. In that way, scripts and programs that 
I've tested for personal use, I can MOVE to that location, and run them 
easily henceforth. But having ~ (home directory) on your path is a Bad Thing 
(tm).

Best of luck,

.brian

-- 
Brian Bilbrey - bilbrey@orbdesigns.com - http://www.OrbDesigns.com/
 Geek for Hire!  http://www.OrbDesigns.com/bpages/resume.html
 Visit LinuxMuse - I^3 at http://www.LinuxMuse.com/ 

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

  parent reply	other threads:[~2002-06-26 13:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-26 12:26 Reg:gcc Sridhar J (june end)
2002-06-26 12:57 ` Reg:gcc Jos Lemmerling
2002-06-26 13:07 ` Reg:gcc Mark Gallagher
2002-06-26 13:45 ` Brian Bilbrey [this message]
2002-06-26 14:22 ` Reg:gcc Gavin Laking

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200206260645.29872.bilbrey@orbdesigns.com \
    --to=bilbrey@orbdesigns.com \
    --cc=linux-newbie@vger.kernel.org \
    --cc=sridharj.hyd@cxknetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.