Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

exec in AWK
Hi!

Does AWK has some analog of shell's exec? I have a shell script that
effectively just wraps an AWK script to setup an environment for a
program and then calls exec on that program. So if AWK would support
exec I would just drop the shell completely.

Any hints?

Thanks in advance, Igor

Report this thread to moderator Post Follow-up to this message
Old Post
Igor Bukanov
03-20-04 01:23 AM


Re: exec in AWK
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Igor Bukanov <igor@fastmail.fm> wrote:
> Hi!

> Does AWK has some analog of shell's exec? I have a shell script that
> effectively just wraps an AWK script to setup an environment for a
> program and then calls exec on that program. So if AWK would support
> exec I would just drop the shell completely.

> Any hints?

Depends on your awk version and *nix system:

- From 'man awk' (GNU awk) on my box:

system(cmd-line)      Execute the command cmd-line, and return the exit
status.
(This may not be available on non-POSIX sys-tems.)

Checking the man page on your box and testing should show.

- --
Michael Heiming (GPG-Key ID: 0xEDD27B94)

Remove +SIGNS and www. if you expect an answer, sorry for
inconvenience, but I get tons of spam.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

 iD8DBQFAQjo3AkPEju3Se5QRAsMAAKCOntjRo1gT
UBzmJFGnFauILBn8BQCcCcxM
T5AmSHBkBAFbC2zikYk4djM=
=iVuN
-----END PGP SIGNATURE-----

Report this thread to moderator Post Follow-up to this message
Old Post
Michael Heiming
03-20-04 01:23 AM


Re: exec in AWK
Michael Heiming <michael+USENET@www.heiming.de> wrote in message news:<pndt1c.uj5.ln@news.h
eiming.de>...
> Depends on your awk version and *nix system:
>
> - From 'man awk' (GNU awk) on my box:
>
> system(cmd-line)      Execute the command cmd-line, and return the exit
> 		      status.
> 		      (This may not be available on non-POSIX sys-tems.)
>

But system is not exec: I do not want to have an additional awk
process to wait until system returns, I would like to replace the
current process image with another one exectly as execl etc. system
calls would do.

It seems that for now I have to stick with shell+awk :(.

Regards, Igor

Report this thread to moderator Post Follow-up to this message
Old Post
Igor Bukanov
03-20-04 01:23 AM


Re: exec in AWK
In article <7f487643.0402291617.14868cd7@posting.google.com>,
Igor Bukanov <igor@fastmail.fm> wrote:
...
>But system is not exec: I do not want to have an additional awk
>process to wait until system returns, I would like to replace the
>current process image with another one exectly as execl etc. system
>calls would do.
>
>It seems that for now I have to stick with shell+awk :(.
>
>Regards, Igor

Write a gawk extension library.


Report this thread to moderator Post Follow-up to this message
Old Post
Kenny McCormack
03-20-04 01:23 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

AWK archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 10:43 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.