NT gawk question 
Author Message
 NT gawk question

Hello !

I have a working awk script on my unix server,
and I would like to port this to NT 4.0.

I have gawk(3.06) woking on a NT 4.0, but what sould I
do with the awk script ?

First line was /usr/local/gawk, shall I change this to
C:\test\gawk.exe ?

This is how I execute the script on the unix server :

./awk-script  text-file  | makemap hash database-name

Is there a FAQ for awk on NT ?

Regards

Roar Pettersen
Bergen - Norway



Sat, 15 Mar 2003 03:00:00 GMT  
 NT gawk question


Quote:
>Hello !

>I have a working awk script on my unix server,
>and I would like to port this to NT 4.0.

>I have gawk(3.06) woking on a NT 4.0, but what sould I
>do with the awk script ?

>First line was /usr/local/gawk, shall I change this to
>C:\test\gawk.exe ?

>This is how I execute the script on the unix server :

>./awk-script  text-file  | makemap hash database-name

>Is there a FAQ for awk on NT ?

Last question first: no NT-specific faq I'm aware of, but there's a
general awk faq that you could find at http://www.faqs.org .

Do you mean the first line of your unix awk script was

#! /usr/local/gawk -f

?? If so, there's no exact NT equivalent. If you bought a unix-like
shell for NT, e.g., the ones in the MKS Toolkit, Cygnus's NT port of
bash, or NT ports of tcsh, zsh or pdksh, you could use similar lines in
the NT version of the awk script, like

#! //c/test/gawk.exe -f

But under NT's own CMD.EXE, you have three choices.

1. Run gawk explicitly:  gawk -f scriptfile other-arguments

2. Wrap the command in 1 into a .BAT or .CMD batch file.

3. Associate the .awk filename extension with the gawk.exe binary so
that awk files could be run like batch files. Use the following NT
commands at a CMD.EXE console prompt:

C:\> ftype AWK_File=C:\test\gawk.exe -f "%L" %*

C:\> assoc .awk=AWK_File

Once done, you can run awk scripts directly from console propmpts as
long as the scripts' filenames end with '.awk'. So if your unix script
were saved as an NT file with filename awk-script.awk, the NT command

C:\> awk-script.awk text-file | makemap hash database-name

should work (as long as you have an NT version of the makemap binary in
a directory in your NT PATH).

Sent via Deja.com http://www.deja.com/
Before you buy.



Sat, 15 Mar 2003 03:00:00 GMT  
 NT gawk question

[ .... ]

Quote:
> I have gawk(3.06) working on a NT 4.0, but what should I do with the
> awk script ?

Is there a binary of gawk-for-NT available for downloading from anywhere?
It's not that I can't build one myself, just that I'm lazy. :-)

The client firm where I'm working has trouble with its software. One
thing they do is write sources for configuration files, then convert them
to binary. Each line of the configuration file contains an identifier
which corresponds with a #define in a C source code, say,

#define CONFIG_THINGY 134

The configuration source file contains "134", not "CONFIG_THINGY",
because the binary generation program was written in C (I kid you not)
and its author seemingly couldn't be bother to write a symbol table
handler. (Who can blame him? There are no such things as associative
arrays in C.)

Needless to say, this use of absolute values wreaks havoc between
different versions of the software.

I'd like to introduce them to awk. A decent replacement for their C
conversion program could be written in under an hour.

Can anybody give me the URL of a downloadable gawk binary for NT?

Many thanks in anticipation.

Quote:
> Roar Pettersen

--
Alan Mackenzie (Munich, Germany)

(like "aa"), remove one of them (leaving, say, "a").


Sat, 15 Mar 2003 03:00:00 GMT  
 NT gawk question


% Once done, you can run awk scripts directly from console propmpts as
% long as the scripts' filenames end with '.awk'. So if your unix script
% were saved as an NT file with filename awk-script.awk, the NT command
%
% C:\> awk-script.awk text-file | makemap hash database-name

Unless they've fixed it very recently, this won't work. If you start
a script from the command-line using the shell association, you can't
redirect input or output.

On the other hand, if you add .awk to the environment variable
PATHEXT, you don't have to type .awk in the command line (ie,
you could type
 awk-script text-file
and maybe have the script pipe the output of its print commands into
makemap internally.
--

Patrick TJ McPhee
East York  Canada



Sun, 16 Mar 2003 10:45:15 GMT  
 NT gawk question

http://sourceware.cygnus.com



Quote:

GMT:

> [ .... ]

> > I have gawk(3.06) working on a NT 4.0, but what should I do with the
> > awk script ?

> Is there a binary of gawk-for-NT available for downloading from
anywhere?
> It's not that I can't build one myself, just that I'm lazy. :-)

> The client firm where I'm working has trouble with its software. One
> thing they do is write sources for configuration files, then convert
them
> to binary. Each line of the configuration file contains an identifier
> which corresponds with a #define in a C source code, say,

> #define CONFIG_THINGY 134

> The configuration source file contains "134", not "CONFIG_THINGY",
> because the binary generation program was written in C (I kid you not)
> and its author seemingly couldn't be bother to write a symbol table
> handler. (Who can blame him? There are no such things as associative
> arrays in C.)

> Needless to say, this use of absolute values wreaks havoc between
> different versions of the software.

> I'd like to introduce them to awk. A decent replacement for their C
> conversion program could be written in under an hour.

> Can anybody give me the URL of a downloadable gawk binary for NT?

> Many thanks in anticipation.

> > Roar Pettersen

> --
> Alan Mackenzie (Munich, Germany)

> (like "aa"), remove one of them (leaving, say, "a").

Sent via Deja.com http://www.deja.com/
Before you buy.


Sun, 16 Mar 2003 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. looking for windows NT/2000 binary for gawk 3.1.1 (or better)

2. Pb with Gawk on NT

3. Looking for NT awk/gawk

4. gawk 3.0.3 nt pipe bug?

5. GAWK 2.15.6 for Windows NT/95, DOS32

6. gawk for 95/NT

7. Gawk for win32 slower than Gawk for Dos_32?

8. Gawk bug, gawk won't nawk.

9. gawk 3.0.95, beta for gawk 3.1.0, now available

10. Gawk 3.1.1 - Question regarding a variable in a print statement and help with code

11. GAWK: Question on using filefuncs.so (creating arrays in extension functions)

12. GAWK 3.0.95 - question on the extensions stuff

 

 
Powered by phpBB® Forum Software