Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this message-----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-----
Post Follow-up to this messageMichael 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
Post Follow-up to this messageIn 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.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.