Search Results

Search: Posts Made By: Mudshark
2,303
Posted By greet_sed
And in sed : sed '/^#/{x;p;x;}' input-file
And in sed :
sed '/^#/{x;p;x;}' input-file
2,303
Posted By RavinderSingh13
Hello Mudshark, Could you please try...
Hello Mudshark,

Could you please try following and let me know if this helps you.

awk '/^#/{print RS $0;next} 1' Input_file

Output will be as follows.

blah
blah #do not insert here
...
3,439
Posted By MadeInGermany
Ravinder, you worked around ...
Ravinder, you worked around
gsub(/[^[:digit:]]/,X,Q)
3,439
Posted By RudiC
Try alsoawk -F\| '{$7=$3; $8="";...
Try alsoawk -F\| '{$7=$3; $8=""; gsub(/^[^0-9]*|[^0-9]*$/, "",$7)} $7' OFS=\| file
1|net|ABC Letr1|1530|||1|
1|net|EXP_1040 ABC|1121|||1040|
1|net|EXP_TG1224|1122|||1224|
1|net|RExp 123 456...
3,439
Posted By RavinderSingh13
Hello Mudshark, Following may help you in...
Hello Mudshark,

Following may help you in same.

awk -F"|" '{Q=$3;gsub(/[[:alpha:]]|[[:punct:]]/,X,Q);sub(/^[[:space:]]/,X,Q);sub(/[[:space:]]+$/,X,Q);$(NF)=Q;if(Q){print $0 OFS}}' OFS="|"...
5,969
Posted By only4satish
print lines between <pattern1> and <pattern2>. ...
print lines between <pattern1> and <pattern2>.

assuming pattren 1 is 'select'
pattern 2 is 'from'

a crude way of printing the lines between pattern1 & pattern2


v1=$(grep -n 'select' ...
5,969
Posted By Don Cragun
Your problem in awk was that /sqry/ was looking...
Your problem in awk was that /sqry/ was looking for a line containing the literal string sqry not the string contained in the variable sqry. To do what you were trying to do in awk, you could have...
5,969
Posted By Scrutinizer
For reference, awk use of variables. There is no...
For reference, awk use of variables. There is no need to escape the double quote:
awk '$0~b,$0~e' b='select_id="x_0' e='from' infile


--
On Solaris, use /usr/xpg4/bin/awk
5,969
Posted By msabhi
How about sed? var='select_id="x_0' ...
How about sed?


var='select_id="x_0' #you need not escape " when using single quote
sed "/$var/,/from/" x.txt
Forum: Solaris 10-28-2012
3,508
Posted By Yoda
This change will not take effect for a user until...
This change will not take effect for a user until that user changes his or her password. To force a user to change his or her password at next login, use the command:

passwd -f <user_name>
88,167
Posted By fenugreek
Try this
find /folder/* -prune -type f -name 'Rajini*'

This works for me on a Solaris system
Showing results 1 to 11 of 11

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