Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
use variable of shell script in awk
Name: T Date: February 6, 2003 at 02:09:55 Pacific OS: Unix CPU/Ram: -
Comment:
Hi i've been trying to write shell script with awk that I want to search a substring with variable of shell script
In old one ,I wrote awk that find 'xxx' in myfile : #!/bin/ksh awk '/xxx/' myfile
but now I want to find a substring with my variable (but it doesn't work): . . . $var = 'xxx' awk '/$var/'my file . . .
Summary: How do i transfer the value from a shell script to awk script... for example: echo "blah.. blah.." read x echo `ls -l | awk '{if (NR=x) print $9}' i'm trying to get the value of x to be insert to the ...
Summary: hi , I have a problem in Korn shell script(in dtksh) my program is like that...... #!/usr/dt/bin/dtksh awk ' BEGIN { FS = ":"; # print '$1','$2','$3' cmdargs = '$#' } { if( cmdargs == 3) {...
Summary: awk does not come with ksh. It is a unix (and now DOS/Windows/etc...) utility and is its own interpreter. awk is a great tool and does a good job at what this person wants. However, many companies ...