Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: bhagya123
1,383
Posted By bhagya123
I tried the script with /usr/xpg4/bin/awk , But...
I tried the script with /usr/xpg4/bin/awk , But it is throwing error at a diff place.

Error :
/usr/xpg4/bin/awk: line 2 (): syntax error "unk" in //

Below is the first 10 lines from the code...
1,370
Posted By bhagya123
This worked, Thanks for your help !!
This worked, Thanks for your help !!
1,383
Posted By bhagya123
Sorry..The error is right at the gsub command in...
Sorry..The error is right at the gsub command in both cases.

below is my unix os version

SunOS unixs1095 5.10 Generic_150400-62 sun4v sparc sun4v
1,383
Posted By bhagya123
Tried this : for...
Tried this :

for (i=msgtkn_20_lnno; i<msg_lnno;)
{
if( msg_arr[i] ~ /^{5:{/ )
{
msg_arr[i]= gsub("{5:{",...
1,370
Posted By bhagya123
Do we need to give space in between svc_in and...
Do we need to give space in between svc_in and svc_out or without any space?
1,370
Posted By bhagya123
Concatenate a string and number and compare that with another string in awk script
I have below code inside my awk script

if ( $0 ~ /SVC IN:/ )
{
svc_in=substr( $0,23 , 3);
if (msg_start == 1 && msg_end == 0)
{
msg_arr[msg_lnno++]=$0;
}
}...
1,383
Posted By bhagya123
sed inside the awk script to replace a string in the array
The requirement is i need to find an array value matching with pattern {5:{ , replace that with 5: and reassign that to same array index and print it.

I write something like below and the issue...
2,154
Posted By bhagya123
Thanks..Actually i tried with substr and it was...
Thanks..Actually i tried with substr and it was working..

Later i encountered an error and thought that is related to to the substr function. But looks like it caused by something else.

Thanks...
2,154
Posted By bhagya123
Its giving the syntax error. --- Post...
Its giving the syntax error.

--- Post updated at 06:27 PM ---

This is how my awk script looks like :

AWK script:

BEGIN {
FS="|$@#!|$@#!";
lno=0;
m_start=0;
m_end=0;
}
{...
2,154
Posted By bhagya123
How to assign a value to a variable in awk scripting?
Hi,

I am trying to assign a value using below command and it is assigning the command to the variable not the output of the command?

out_value="echo $0 | cut -c 9-11";

How can i assign the...
Showing results 1 to 10 of 10

 

Featured Tech Videos

All times are GMT -4. The time now is 03:19 PM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy