Search Results

Search: Posts Made By: RavinderSingh13
174
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
174
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...
Forum: What is on Your Mind? 1 Week Ago
546
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...
381
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...
526
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
592
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
620
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 3 Weeks Ago
235
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.
...
474
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
984
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...
572
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...
649
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...
649
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,038
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...
779
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
173
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...
1,073
Posted By RavinderSingh13
Hey nez, How about some Monday fun :cool: ...
Hey nez,

How about some Monday fun :cool:


echo "all of the kings of Norway" | awk '{sum+=gsub(/of/,"&")} END{print sum}'


Taken example from Jim's sample echo message, cheers.

Thanks,...
1,073
Posted By RavinderSingh13
Hello milhan, If you see OP's question...
Hello milhan,

If you see OP's question carefully, OP needs to know total number of matched count of string NOT number of lines and as per your posted quote seems -c Option gives matched number of...
1,012
Posted By RavinderSingh13
Hello nez, How are you? I hope you are...
Hello nez,

How are you?
I hope you are doing fine :)

For your this solution, if you ask me IMHO we could avoid using renaming of a Input_file with system while reading Input_file itself...
Forum: What is on Your Mind? 12-24-2019
169
Posted By RavinderSingh13
Merry Christmas 2019 :) :)
Hello All,

I would like to wish merry x-mas to all of you. May GOD bless us all with wisdom, love, positivity and great positive energy, cheers and happy holidays :)

Thanks,
R. Singh
891
Posted By RavinderSingh13
Hello cowa, Welcome to forums, special...
Hello cowa,

Welcome to forums, special thanks for using CODE TAGS for samples.

On UNIX.com we encourage users to show their efforts in their questions which they have put in order to solve...
Forum: What is on Your Mind? 12-22-2019
300
Posted By RavinderSingh13
Hey Neo, IMHO Rich is who is blessed with...
Hey Neo,

IMHO Rich is who is blessed with knowledge and you are blessed with it(with your hard work, intelligence you gained it). So you are Richer than most of influential people out there IMHO...
Forum: What is on Your Mind? 12-22-2019
300
Posted By RavinderSingh13
Hello Neo, Sorry for not mentioning details...
Hello Neo,

Sorry for not mentioning details in post.

What personally I like is the way A.I progressing in video they shown how they are making a baby(virtual one) learn by feeding data to it(I...
Forum: What is on Your Mind? 12-21-2019
300
Posted By RavinderSingh13
A nice YT video on A.I
Hello All,

Just went through a nice YT video of A.I

Age of A.I YT video (https://youtu.be/UwsrzCVZAb8)

See who is the host of this video :) if you are a Hollywood fan(a bit spoiler)
I...
911
Posted By RavinderSingh13
Hello tomato00, Could you please try...
Hello tomato00,

Could you please try following.


cat script.ksh
declare -a arr=("test" "Monday" "Tuesday" "Wednesday" "Thurday" "Friday" "Saturday" "Sunday")

while read first second...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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