Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sytem Call 1

Status
Not open for further replies.

frangac

Technical User
Feb 8, 2004
163
ZA
Hi All,

Is there a way to call a system call and not produce the wording of "stty: : Not a typewriter"
My scripts goes like this:

RAW=`awk 'BEGIN{
system("which Chris")
}'`
and then I run
$RAW $2 | awk '{
for (e=1;e<NF;e++){if ($e~/P=7f/)
{printf "%s %s %15s %s\n" ,$(e+2) ,$11, $16,$13
}
}'

Many Thanks
Chris
 
what are you trying to do?
why do you have the first awk?

would it be easier to do:
Code:
( $(which Chris); echo ${2}) | awk ....

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Hi Vlad,

Why RAW, is because this is a binary executable which can reside on any dir (more than one machine) and I use it to read $2 (converts it to text) calling awk to print the necessary fields.

Thanks
Chris
 
Have you tried this ?
system("which Chris 2>/dev/null")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi PHV,

Long time no hear. Anyway Thanks it works.

Many Thanks
Chris
 
frangac

sure it (stupidly) works, as 90% of all scripts do.
georges brassens, a top french poet && chansonnier,
called what you are doing, "jouer tout seul"
i let you find out what's mean.

you start an AWK starting a SYSTEM-CALL starting
an UNIX-exec to get a value, used as EXEC for the
next step (NOTA: w/o checking status).

schoen (this was german)

why not
`which Chris` $2 | awk ........
or just let awk
do the job, parsing 'Chris' && "$2" ?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top