Search Results

Search: Posts Made By: RavinderSingh13
322
Posted By RavinderSingh13
Hello jeo_fb, Sorry but this is NOT the way...
Hello jeo_fb,

Sorry but this is NOT the way UNIX.com forums work. We do encourage people to add their efforts which they have put in order to solve their own problems, so please do add your...
358
Posted By RavinderSingh13
Hello shanul karim, Sorry but this is NOT...
Hello shanul karim,

Sorry but this is NOT the way UNIX.com forums work. We do encourage people to add their efforts which they have put in order to solve their own problems, so please do add your...
168
Posted By RavinderSingh13
Hello Nez, Cool; thanks for letting your...
Hello Nez,

Cool; thanks for letting your views , but IMHO why I added that checks in case version is in some other format then it shouldn't have false positive in output.

Thanks,
R. Singh
168
Posted By RavinderSingh13
Regex learning.
Hello All,

I have come across a question from colleague about complex regex, so I written a regex using grep's -P option in PCRE regex. Since its a new learning for me, so thought to share with...
199
Posted By RavinderSingh13
Hello rohit_shinez, In unix.com we encourage...
Hello rohit_shinez,

In unix.com we encourage all users to do add their efforts which they have put to solve their own problem so kindly do add the same and let us know then.

Thanks,
R. Singh
Forum: What is on Your Mind? 6 Days Ago
514
Posted By RavinderSingh13
Thanks a TON Neo for awarding this to...
Thanks a TON Neo for awarding this to Scrutinizer, a well deserved award S :b:

@Scrutinizer, First of all congrats S :b: First thing first, your posts are Good, concise, Up to the mark, full of...
359
Posted By RavinderSingh13
Hello becal123456, IMHO problem in your code...
Hello becal123456,

IMHO problem in your code is that you haven't done any increment on very first occurrence of a[$2 FS $4 FS $5 FS $6 FS $7] and when it goes into condition check happens first...
359
Posted By RavinderSingh13
Hello beca123456, Could you please try...
Hello beca123456,

Could you please try following.


awk '/^grp1/{print;a[$2,$4,$5,$6,$7]++;next} !a[$2,$4,$5,$6,$7]++' Input_file


Output will be as follows.


grp1 name2 ...
504
Posted By RavinderSingh13
Hello hungryd, Could you please try...
Hello hungryd,

Could you please try following.


awk '
{
while(match($0,/<SeriesName>[^<]*/)){
print substr($0,RSTART+12,RLENGTH-12)
$0=substr($0,RSTART+RLENGTH)
}
}
' ...
Forum: Shell Programming and Scripting 2 Weeks Ago
563
Posted By RavinderSingh13
Hello pranabpal, In UNIX.com we encourage...
Hello pranabpal,

In UNIX.com we encourage users to add 3 simple things.

1- Sample of Input in CODE TAGS.
2- Sample of expected output in CODE TAGS.
3- Most important thing, add efforts which...
Forum: Programming 2 Weeks Ago
599
Posted By RavinderSingh13
Thanks for sharing nice code wisecracker :b: ...
Thanks for sharing nice code wisecracker :b:
Please forgive me if I am wrong here, I believe shebang should be #!/bin/bash right?
Or please correct me if I missed something here, cheers.

Thanks,...
Forum: Shell Programming and Scripting 2 Weeks Ago
234
Posted By RavinderSingh13
Use parameter expansion over a parameter expansion in bash.
Hello All,

Could you please do help me here as I would like to perform parameter expansion in shell over a parameter expansion.

Let's say I have following variable.
...
450
Posted By RavinderSingh13
Hello Tuxidow, Could you please try...
Hello Tuxidow,

Could you please try following.


awk -F'\\|\\^' '$3==""{next} $4' Input_file


NOTE: After seeing Rudi sir's comment edited this solution now.

Thanks,
R. Singh
Forum: What is on Your Mind? 3 Weeks Ago
957
Posted By RavinderSingh13
Thanks a TON Neo for giving me this GREAT honor...
Thanks a TON Neo for giving me this GREAT honor :b:, its always an honor to be a member of this GREAT site :b:, whatever I know in scripting/*nix I learnt from this forum/site and whatever way or...
508
Posted By RavinderSingh13
Hello gc_sw, On UNIX.com we do encourage...
Hello gc_sw,

On UNIX.com we do encourage users to add their efforts which they have put in order to solve their own problems.
So kindly do edit your post and add the attempted code by you and let...
560
Posted By RavinderSingh13
Hello big123456, IMHO I think you are...
Hello big123456,

IMHO I think you are looking for grep -l option, since it will only print Filenames which have that specific text in them, try something like:


find /tmp/ -type f -exec grep...
646
Posted By RavinderSingh13
Thank you :) For your questions, why a[$1]...
Thank you :)

For your questions, why a[$1] didn't throw errors because if any variable is NOT initialized in awk and we are using it in any condition or etc then its value will be considered as...
646
Posted By RavinderSingh13
Hello beca123456, Could you please try...
Hello beca123456,

Could you please try following.


awk 'BEGIN{FS=OFS="|"} FNR==NR{b[$1]=length($3)>a[$1]?$3:b[$1];a[$1]=length($3)>a[$1]?length($3):a[$1];next} length($3)<a[$1]{$3=b[$1]} 1' ...
1,035
Posted By RavinderSingh13
Hello abhaydas, Always try to following rule...
Hello abhaydas,

Always try to following rule of 1 thread ==> 1 question please.

Geeks have really helped you in this thread, so for future users who want to get reference from this thread, will...
776
Posted By RavinderSingh13
Hello kumarinfa, For Thanking someone on...
Hello kumarinfa,

For Thanking someone on Unix.com you could HIT THANKS button at the left corner of each post.

For your other question in your previous post, I believe my same command should...
1,035
Posted By RavinderSingh13
Your Welcome. On unix.com we Thank people for...
Your Welcome. On unix.com we Thank people for useful posts by hitting THANKS button at each post's last left side, you could do so too, cheers and happy learning.

Also don't forget to put code...
1,035
Posted By RavinderSingh13
Hello abhaydas, I don't have Solaris so...
Hello abhaydas,

I don't have Solaris so couldn't test it, should work but. Could you please try following.


sed '3s/^/#/' abc.txt > temp && mv temp abc.txt


Thanks,
R. Singh
776
Posted By RavinderSingh13
Hello kumarinfa, Following is the complete...
Hello kumarinfa,

Following is the complete explanation.


awk ' ##starting awk program from here.
{
split($NF,array,"[_.]") ##Using split to...
776
Posted By RavinderSingh13
Hello kumarinfa, I am considering that you...
Hello kumarinfa,

I am considering that you have saved output of ls command into a file and then I have written this code.


awk '{split($NF,array,"[_.]");$NF=array[2] OFS $NF} 1' Input_file
...
Forum: What is on Your Mind? 01-01-2020
172
Posted By RavinderSingh13
Happy New Year 2020 to all :)
Hello All,

I would like to wish A very Happy New Year 2020 to all. May GOD bless all of us with TRUE knowledge, wisdom, great attitude, honesty, hard working capability, great health :b:

Cheers...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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