FP Survivor - Replacement CD on the way.
John Esak
john at valar.com
Mon Aug 15 10:57:32 PDT 2005
> -----Original Message-----
> From: Todd [mailto:todd at weshyd.com]
> Sent: Monday, August 15, 2005 12:39 PM
> To: john at valar.com
> Subject: Re: FP Survivor - Replacement CD on the way.
>
> Hi John,
>
> First I want to say these cd's are great. I haven't got to the advanced
> yet. I started learning in the first few minutes of the first cd.
> You sent
> me a 2nd beginner cd because you thought one was a mislabeled
> Intermediate
> cd. All of my original cd's were labeled correctly. No big deal
> on my end,
> I just wanted to make sure your records on your end are correct.
> I did have a question not directly related to filepro, but a unix
> question. I saw you changing environments with the "." dot command. How
> does that work? Can you point me in a direction to find info on
> that? I did
> try a man ..
>
> Thanks for the great cd's.
>
> Todd
Hi Todd,
Glad to hear you are enjoying the CD's. You have an extra Beginning now...
no big deal. :-) Sorry, but as I wrote a couple of days ago... I want to put
all the comments (both positive and negative... hope no negative) up here on
the list. It makes me feel good and the questions will help everybody maybe?
As for the . thing. Essentially, the . means to "exec" the script I'm
calling. That means run it in a brand new shell, don't run it as a subshell
and return to the calling shell. So I do things like this all the time.
The shell script might read:
cd /u/appl/filepro
echo "You are now sitting in /u/appl/filepro..."
If the script is called "fp", I just do:
. fp
at the prompt and I'm cd'd to the directory and it tells me I'm there. (I
work as filepro a lot to be able to do this... by the way...)
Or I set some environment variables like:
PFTERM=ansic; export PFTERM
and then if the script is called "ansi", I do:
. ansi
which runs my termcap for filePro to ansi.
I have a reversing script called "ansi-nc" which does not have the PV
variable I describe in the tutorial in it. By doing:
. ansi-nc
I am put into the mode I like which doesn't have ansi colors.
The . is very useful in this regard. Think of it this way. If the script
says...
cd /u/appl/filepro
echo "You are sitting in /u/appl/filepro..."
and you just execute that script by itself (without the dot). It would run
out in a subshell, cd you to /u/appl/filepro, tell you it did it... and then
immediately dump you back to the calling shell.... which leaves you wherever
you were sitting and with the same environment you had before you executed
the command. It's much like running "dclerk" from a shell prompt. It runs
out and brings up dclerk, which you use until you are done. When you exit
dclerk, you are right back where you started from.
Incidentally, if you were to use the . inside a shell script... it has a
completely different aspect. It is called "sourcing" and you might do
something like this:
TERM=ansi
LPDEST=mary
PFSCC=ON
export TERM LPDEST PFSCC
. otherfile
And in "otherfile" would be 50 more environment variable assignments (and
their associated export). The file sources that "otherfile" for this
information and includes it in the current script as if you had typed it all
in to this script like the first 3 variables.
Hope this helps.
--
John Esak
Visit The FP Room www.tinyurl.com/97y9u 24/7
Author of:
The filePro Survivor Series
Video training on CD for filePro.
Samples at: www.valar.com/training
More information about the Filepro-list
mailing list