Search Results

Search: Posts Made By: jville
1,616
Posted By vgersh99
awk -f jv.awk numbers.txt where jv.awk is: ...
awk -f jv.awk numbers.txt where jv.awk is:

BEGIN {
if (!pat) pat="ten thirteen sixteen"
if (!lines) lines=4
split(pat, tA, FS)
for(i=1;i in tA;i++)
patA[tA[i]]
}
{ a[FNR]=$0 }...
1,616
Posted By zaxxon
$ for text in ten thirteen sixteen; do awk -v...
$ for text in ten thirteen sixteen; do awk -v wText="$text" '{a[++i]=$0} $0 ~ wText {for(j=NR-4; j<=NR; j++) {print a[j]} print "" }' number.txt; done
six
seven
eight
nine
ten

nine
ten...
1,435
Posted By Scrutinizer
Try: awk -F= -v a="MonsterHouse.Scully" -v...
Try:
awk -F= -v a="MonsterHouse.Scully" -v b="Mickey/Minie" '{if ($1 ~ "ORACLE_HOME" ) printf "ORACLE_HOME=%s\n",a;
else if ( $2 ~ /perm_loc/ ) {gsub("perm_loc",b); print} else print}' file
1,435
Posted By Akshay Hegde
You are almost done print...
You are almost done

print (gsub("perm_loc",b));

its prints the count of substitution



awk -F'=' -v a="MonsterHouse.Scully" \
-v b="Mickey/Minie" '{
...
2,024
Posted By Scott
This has to do with your choice of delimeter (/),...
This has to do with your choice of delimeter (/), since the string would expand to:

perl -pi -e "s/XXREF_URLXX/\Qhttp://vmdis01.corp.testcompany.web/ABC_1.0_Version/index.htm\E/g;" test_url.txt
...
1,334
Posted By alister
I believe the globbing is the problem. If...
I believe the globbing is the problem. If [:lower:] matches a filename, the lower case x won't appear in the first argument to tr and will not be converted.

The issue with locales which interleave...
1,334
Posted By Corona688
Probably a character-set thing. The GNU...
Probably a character-set thing. The GNU utilities try to abide by your character set whenever possible, and UTF8 is increasingly standard, but the definition of :lower: and :upper: for UTF8 is going...
1,259
Posted By danmero
Sorry, I'm not the one :rolleyes: however you can...
Sorry, I'm not the one :rolleyes: however you can take a look at http://wiki.bash-hackers.org/syntax/pe
2,814
Posted By verdepollo
A similar solution using sed: sed '/tropical...
A similar solution using sed:

sed '/tropical forest/n;s/\(.*on wed.*\)/#\1\non mon tue wed they would eat berries/1' infile

This pretty much looks like homework, though.
2,814
Posted By Shell_Life
There are several questions that can be asked and...
There are several questions that can be asked and many scenarios that can be created based on your description.

In any event, not to get too complicated, here is one possible solution based...
1,317
Posted By vgersh99
Surprised? Use 'awk' instead.
Surprised? Use 'awk' instead.
1,317
Posted By sk1418
sed -nr 's#(^second file : ).*(...
sed -nr 's#(^second file : ).*( CLIENT2)#\1/a/b/c/script.sh driver file\2#;p' yourFile

replace the parts that you like to varialble.
1,317
Posted By ctsgnb
awk '$0~/^second/{sub(".*","second file :...
awk '$0~/^second/{sub(".*","second file : /a/b/c/script.sh driver file "$NF,$0)}1' infileor

nawk '$0~/^second/{sub(".*","second file : /a/b/c/script.sh driver file "$NF,$0)}1' infile
Showing results 1 to 13 of 13

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