Invoking awk from different directories/PATH 
Author Message
 Invoking awk from different directories/PATH

I have written a small system of data manipulation using awk and would like
to 'hand over' the software to a live user. When testing future  amendments
etc, I only want the program(s) being amended to be picked up from the test
software directory , and all other software to be picked up from the live
software directory. Putting the awk programs in a directory on the 'PATH'
doesn't seem to do anything - you have to explicitly enter the full
location of the awk program you are running. Is there any of specifying a
PATH which tells the system where and in what order to search for awk
programs, in the same way as SHELL scripts are searched for using the PATH
environment variable. Please reply to the newsgroup or send a reply to



Mon, 28 May 2001 03:00:00 GMT  
 Invoking awk from different directories/PATH
For gawk, the environment variable AWKPATH may specify a search path
for -f files.

--
Maurizio Loreti                      http://wwwcdf.pd.infn.it/~loreti/mlo.html



Mon, 28 May 2001 03:00:00 GMT  
 Invoking awk from different directories/PATH

Quote:

> Is there any of specifying a
> PATH which tells the system where and in what order to search for awk
> programs, in the same way as SHELL scripts are searched for using the PATH
> environment variable.

At least GNU AWK can do this:

       The environment variable AWKPATH specifies a  search  path
       to use when finding source files named with the -f option.
       If this variable does  not  exist,  the  default  path  is
       ".:/usr/local/share/awk".  (The actual directory may vary,
       depending upon how gawk was built and  installed.)   If  a
       file  name given to the -f option contains a ``/'' charac-
       ter, no path search is performed.

Dont know about other AWKs.

+---------------------------------------------------------------------+
| Juergen Kahrs,       STN Atlas Elektronik GmbH,   D-28305 Bremen    |
| Simulation Division  Sebaldsbruecker Heerstr. 235 +49/421/457-2819  |
+----------- http://home.t-online.de/home/Juergen.Kahrs/ -------------+



Mon, 28 May 2001 03:00:00 GMT  
 Invoking awk from different directories/PATH

Quote:

> I have written a small system of data manipulation using awk and would like
> to 'hand over' the software to a live user. When testing future  amendments
> etc, I only want the program(s) being amended to be picked up from the test
> software directory , and all other software to be picked up from the live
> software directory. Putting the awk programs in a directory on the 'PATH'
> doesn't seem to do anything - you have to explicitly enter the full
> location of the awk program you are running. Is there any of specifying a
> PATH which tells the system where and in what order to search for awk
> programs, in the same way as SHELL scripts are searched for using the PATH
> environment variable. Please reply to the newsgroup or send a reply to


I gather from your article that your users are entering

   awk -f /path/to/your/awkfile

and you would rather have them enter:  

   awk -f awkfile

If you are on a UNIX system,  why not set it up so they only have to
enter

   awkfile

To make a standalone executable out of an awk file,  first use
chmod to add execute permission,  then place an exec string as the first
line,  for instance:

#!/usr/bin/awk -f

Then place the file in the users PATH.

Dan Mercer

Opinions expressed herein are my own and may not represent those of my employer.



Mon, 28 May 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Passing the current directory path to a variable - awk on a PC

2. Making file path control only select directory paths not file names

3. Invoking shell command from within awk

4. Alias TPS with different path/file name than original file

5. Pythonwin Browse PythonPath and Idle Path Browser shows different content

6. load PATH on different platforms

7. REPOST: Re: import path, script path (was Re: module path)

8. paths, directories in a deployed image

9. How to specify Data file directory diff from app path

10. ! - windows directory path (CW2.0)

11. how to get a path of Windws directory

12. Resolving directories to the full path

 

 
Powered by phpBB® Forum Software