Hi,
I have a program that searches for a particular string patten. I am however having difficulty passing the varible $i (in a loop) as the string pattern to replace. Using either perl or sed search and replace statements, I get the same kinda result. For example, using the perl:
for i in... (3 Replies)
i would like to pass a variable to awk wherein the variable comes from external loop.
i tried this...
let x=0
until test $x -eq 32
do
cat file | awk '{ print $1 , "Number" , $($x) }' >> output
done
thanks, (4 Replies)
Hi,
Can i pass a parameter(not a file name) as a parameter to a awk program?
eg;
$awk -f test 1 2 3
here test is the filename...and 1,2,3 are the i/p parameters?
thank you:-) (2 Replies)
I am trying to pass 2 shell variable's ("START" and "END") define earlier in the script to this awk statement, but i can't seem to pass it on. PLs help.
set START = xxxx
set END = yyyy
set selected_file = `awk '/$START/,/$END/' filename` (24 Replies)
I have an awk statement where I Need to pass an environment variable but I cannot get it to work:
My evironment varible examples below:
$FILE1=/dev/fs/file.new
$FILE2=/dev/fs/file.old
Code below:
awk -F"|" '
BEGIN {
while( getline < "$FILE1" )
{ arr=1 }
}
arr != 1 { print }
'... (12 Replies)
Hey guys I have here what I am sure amounts to a pretty dumb question.... how do I assign a value of say 999 to a variable called "random number" (note the space between random and number). What would the script look like using borne shell?
Thanks! :) (4 Replies)
I am trying to set a variable from this AWK command in KSH but I keep getting an error that says my variable cannot be found.
LOADNO = $(awk -F"|" 'NR==1{print $2}' file.txt)
If I just run awk -F"|" 'NR==1{print $2}' file.txt I get the right value but as soon as I try to assign this... (1 Reply)
Hi,
I am trying to pass awk field to a command line executed within awk (need to convert a timestamp into formatted date).
All my attempts failed this far.
Here's an example.
It works fine with timestamp hard-codded into the command
echo "1381653229 something" |awk 'BEGIN{cmd="date -d... (4 Replies)
Hi,
I am analyzing linux script, below is the following script line
${AA_APP:-/opt/ty/aa}/sbin/save_file_list ApplEnv.prererun ${AA_APP:-/opt/ty/aa}/sbin/ApplEnv.install_save_list
I really dont understand what this line does, can someone explain me.
AA_APP is variable... (4 Replies)