Search Results

Search: Posts Made By: kchinnam
7,216
Posted By kchinnam
Thanks XL. I do not see single quotes in...
Thanks XL. I do not see single quotes in properties, I will try to wrap values in single quotes first, then use your script to expand variable substitution. Thanks for taking time to look into it.
7,216
Posted By kchinnam
props are defined for huge real world app, I...
props are defined for huge real world app, I can't change existing format.
If its just keyName I would have replaced '.' with '_' and back. values have all kinds of special characters like '='
7,216
Posted By kchinnam
Reading properties from file and setting variable values
I want to read properties from a file and print evaluated values of each key.
I am using AIX6.1.



myfile.props
protocol=http
siteA.host=siteAhostname
pageA=pageNameA...
2,079
Posted By kchinnam
I ran it on a small sample data in one folder,,...
I ran it on a small sample data in one folder,, its working great.. Not sure why its getting "." at the end!?


299 ERROR .
299 RUNTM .
299 OTHER .
2,079
Posted By kchinnam
Counting total files with different file types in each folder
Trying to count total files with different file types with thousands of files in each folder.
Since some files do not have extensions I have to use below criteria.

Count Total Files starting...
7,243
Posted By kchinnam
That is awesome.. works great.
That is awesome.. works great.
7,243
Posted By kchinnam
Extract multiple values into corresponding variables
Here is my input

# MANIFEST.MF
Manifest-Version: 1.0
Build-Jdk: 1.6.0
Built-By: CM_TEAM
Build_SvnRev: 662789
Build_Number: 13.0.0.0-JDK8
Build_Date: Wed 04/05/2017-20:48:19.17...
1,719
Posted By kchinnam
Parameter substitution is not working with sed
I am trying add a prefix variable(string) to command output.
sed parameter substitution is not working.

- I have found some issues on my end of testing,, please delete this thread for now.
2,804
Posted By kchinnam
Thanks Don your code works for me.
Thanks Don your code works for me.
2,804
Posted By kchinnam
How do I select certain columns with matching pattern and rest of the lines?
I want to select 2nd, 3rd columns if line has "key3" and print rest of the lines as is.


# This is my sample input
key1="val1" key2="val2" key3="val3" key4="val4"
some text some text
some...
1,297
Posted By kchinnam
Three quotes are used to assign multi-line text...
Three quotes are used to assign multi-line text to variable without any interpretations by shell.
Double quotes would cause text to be interpreted(variables expanded) by shell, so it is not a good...
1,297
Posted By kchinnam
I have GNU bash, version 3.2, SuSE Linux. ...
I have GNU bash, version 3.2, SuSE Linux.
Again I have this working using lengthy basic for loops, grep and if statements. Love to see If there is an efficient way of doing this without lot of...
1,297
Posted By kchinnam
Print lines present in first that match second variable. And ones that does not exist in second.
I have multi line input(var1) and reference(var2) variables.

How to capture lines not present in var2 but present in var1?

How to capture lines present var2 but not in var1?


#...
3,631
Posted By kchinnam
Hi Rudi your command is working great as well. ...
Hi Rudi your command is working great as well.
One benefit I see with R.Singh's is even if jvm names in first column are not in sorted order(next to each),, output is producing uniq jvms with...
3,631
Posted By kchinnam
Sorry for causing confusion with input.. I used...
Sorry for causing confusion with input.. I used extra empty line for readability.
R. Singh your command works great.. Can you explain how this part of awk works?
($1 in A){$1=X} {A[Q]=A[Q]?A[Q]...
3,631
Posted By kchinnam
I verified if input file has "\r" using "od -c" I...
I verified if input file has "\r" using "od -c" I do not see carriage return characters. Still I followed your suggestion. I am getting same result.

# cat infile.txt
jvm01, Web 2.0 Feature Pack...
3,631
Posted By kchinnam
Both options are not working. # awk...
Both options are not working.


# awk '{for(i=3; i<=NF; i+=2) $i=x; gsub(FS FS,FS)}1' RS= FS=, OFS=, file
jvm01, Web 2.0 Feature Pack Library, IBM WebSphere JAX-RS, Custom01 Shared Library, Web...
3,631
Posted By kchinnam
Bring values in the second column into single line (comma sep) for uniq value in the first column
I want to bring values in the second column into single line for uniq value in the first column.
My input

jvm01, Web 2.0 Feature Pack Library
jvm01, IBM WebSphere JAX-RS
jvm01, Custom01 Shared...
2,587
Posted By kchinnam
Awsome, Aia
Awsome, Aia
2,587
Posted By kchinnam
Here is simplified case.. perl one liner can...
Here is simplified case..
perl one liner can get quite big if we have to extract more fields from XML.
So how can we break text in single quotes perl -nle '</regex/ and all kinds of logic'...
2,587
Posted By kchinnam
How to add line breaks to perl command with large text in single quotes?
Below code extracts multiple field values from XML into array and prints all in one line.

perl -nle '@r=/(?: jndiName| authDataAlias| value| minConnections| maxConnections| connectionTimeout|...
9,811
Posted By kchinnam
Don, With awk I am noticing wild swings within...
Don,
With awk I am noticing wild swings within few minutes gap. At the same time perl solution performance is pretty consistent with little variation.

I am dropping my original solution from...
9,811
Posted By kchinnam
I have SuSe Linux 11 VM with 8GM RAM(300 MB free)...
I have SuSe Linux 11 VM with 8GM RAM(300 MB free) 2 CPU cores.


# XML has 151 matching xml nodes(lines)
perl -nle '/<factories.*baseQueueName/ and @r=/(?:jndiN|baseQueueN|n)ame="([^"]+)/g and...
9,811
Posted By kchinnam
performance is same with in-line first part of...
performance is same with in-line first part of regex in perl vs grep + perl.

Can you explain what is the meaning of below two expressions in your command?

'?:'
"([^"]+)
9,811
Posted By kchinnam
Aia, thanks for trying,, I knew a wicked one...
Aia, thanks for trying,, I knew a wicked one liner like you gave could do this..
Don, please check performance stats,, I am bash/awk lover,, we have work to do..


grep...
Showing results 1 to 25 of 198

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