Re: newb commandline scripting and c/c++
Re: newb commandline scripting and c/c++
- Subject: Re: newb commandline scripting and c/c++
- From: Norman Gray <email@hidden>
- Date: Sun, 24 Aug 2008 19:50:11 +0100
Greetings.
Others have given good advice about steering clear of /usr/bin
(nothing should ever be installed here -- it 'belongs' to the unix
vendor), and shell scripting (the default OS X shell is zsh, which is
of the sh/bash family, so a basic sh-scripting guide would apply).
However,
On 2008 Aug 24, at 16:38, Steve wrote:
I then opened a new file with vi calling it myc and I put the
following line in it:
cd /Developer/sandbox/myc
The issue here is slightly subtle, and might not be apparent from the
first pages of a scripting introduction, so it might be useful to
explain it here.
Every (non-built-in) command you type starts a new child process,
including the script which contains this line. When you invoked it,
it created a new process, which was almost completely a copy of your
existing process, and then it changed directory _within that
process_. The script, and the process, then terminated, leaving the
current directory in the parent unchanged. Check your sh-intro under
the description of 'export' for environment variables.
All the best,
Norman
--
Norman Gray : http://nxg.me.uk
Physics and Astronomy, University of Leicester
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden