Export a Unix variable named File.
Brian K. White
brian at aljex.com
Wed Aug 2 09:48:26 PDT 2006
----- Original Message -----
From: "Kenneth Brody" <kenbrody at bestweb.net>
To: "George" <gclute at comcast.net>
Cc: <filepro-list at seaslug.org>
Sent: Tuesday, August 01, 2006 7:28 PM
Subject: RE: Export a Unix variable named File.
> Quoting George (Tue, 1 Aug 2006 15:22:30 -0700):
> [...]
>> Thanks for the replies.
>>
>> What kind of fp environmental variable can I set to have getenv "file"
>> provide a unique file name on every invocation? This simple export may
>> run at random times per hour.
>>
>> Using: export ascii exp=("/tmp/" { getenv("file")) r=\n f=, -x
>>
>> Now it just writes a /tmp/.wp on every run.
>
> Well, both of your examples used "$file", so I assumed you already had
> some environment variable that you were using. (After all, you did say
> that "-p $file" on the command line worked.)
>
> If you don't have an environment variable already set, then you can use
> the current date and time (stripping the "/"s and ":"s), as long as
> there won't be two exports run within a second of each other. (How
> will "the other program", which is to import these files, know what
> filename you used?)
If your env variable was merely set, like this:
file=myfile1234.txt
and not set & exported, like this:
file=myfile1234.txt ; export file
Then $file would work at the command line and not in any child processes.
When you run say rreport or rclerk, that's a child process of your shell.
add a command "export file" before your clerk/report/runmenu/p/whatever
and then getenv("file") will work inside filepro.
Brian K. White -- brian at aljex.com -- http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO FreeBSD #callahans Satriani Filk!
>
> --
> KenBrody at BestWeb dot net spamtrap: <g8ymh8uf001 at sneakemail.com>
> http://www.hvcomputer.com
> http://www.fileProPlus.com
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
More information about the Filepro-list
mailing list