Search Results

Search: Posts Made By: mjavalkar
2,960
Posted By Corona688
STATUS=$(crontab -l 2>&1)
STATUS=$(crontab -l 2>&1)
7,496
Posted By Chubler_XL
Put $c outside of single quotes: #!...
Put $c outside of single quotes:

#! /bin/bash
a=`grep -n "<name>abc</name>" file.txt` | awk '{print $1}'`
b=`echo ${a%?}`
c=`expr b+2`
sed $c'a\
\t<Property>\
\t\t<name>lmn</name>\...
1,953
Posted By pamu
awk -F "[<>.]" 'NR==1{print "Name Template...
awk -F "[<>.]" 'NR==1{print "Name Template Prequire1 Prequire2 Prequire3"}
/<name>/{n=$3}
/<template>/{t=$3}
/<\/prerequire>/ {if(NF > 4){if(s){s=s","$3}else{s=$3}}}
/<\/entity>/{if(t){print...
1,953
Posted By pamu
awk -F "[<>.]" 'NR==1{print "Name Template"} ...
awk -F "[<>.]" 'NR==1{print "Name Template"}
/<name>/{s=$3}
/<template>/{s=s"-"$3;print s;s=""}' file
1,953
Posted By elixir_sinari
You could have mentioned that in the original...
You could have mentioned that in the original post itself. Your output in that post did not require this constraint. In future, mention your requirements clearly and fully.
awk -F'[<>.]'...
1,953
Posted By pamu
awk -F "[<>.]" 'NR==1{print "Name Template"} ...
awk -F "[<>.]" 'NR==1{print "Name Template"}
/<name>/{if(s){print s"-";s=$3}else{s=$3}}
/<template>/{s=s"-"$3;print s;s=""}' file
1,953
Posted By elixir_sinari
This works on your sample data: awk -F'[<>.]'...
This works on your sample data:
awk -F'[<>.]' '/<entity>/,/<\/entity>/{
if(/<name>/) n=$3
if(/<template>/) t=$3
if(/<\/entity>/) {print n,t;n=t=""}}' OFS=' - ' file
1,329
Posted By 47shailesh
something like this tr -s " " "\n" < infile |...
something like this
tr -s " " "\n" < infile | egrep -o "loginIdPattern.*|orgIdPattern.*"
1,329
Posted By Chubler_XL
You should really show what output you would like...
You should really show what output you would like for the supplied file.

How about this:

awk '/<aaaRule /{for(i=2;i<NF;i++)
if ($i ~ "^orgIdPattern=|l^oginIdPattern=") print $i}' RS='/>'...
1,836
Posted By Scrutinizer
awk -F"<|>" '/<com:name>secretKey</ &&...
awk -F"<|>" '/<com:name>secretKey</ && getline{print $3}' infile
14,112
Posted By Scrutinizer
You are not setting the variable $ip . It...
You are not setting the variable $ip .

It seems to me you are confusing
while ip= read -r line

while IFS= read -r line

no?

although I suspect you may want to leave that out, since you...
Showing results 1 to 11 of 11

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