Search Results

Search: Posts Made By: RavinderSingh13
Forum: Programming 03-13-2020
12,841
Posted By RavinderSingh13
Honestly Neo, they allow are not that is...
Honestly Neo, they allow are not that is secondary for me right now; because let me first learn and automate GOOD stuff which can help people in avoiding monotonous tasks. If I could do in Telegram...
Forum: Programming 03-13-2020
12,841
Posted By RavinderSingh13
Thank you for encouragement Neo :b: Yes, I...
Thank you for encouragement Neo :b:

Yes, I did some stuff from this one(already written almost 8 to 9 functions).

But in company I believe they will NOT allow Telegram(since it could be...
Forum: Programming 03-12-2020
12,841
Posted By RavinderSingh13
Hello Neo/All, Very glad to tell you that...
Hello Neo/All,

Very glad to tell you that after getting inspired from Neo I have build my own very first Bot in Telegram + NR + shell + python(a bit) + JS suit as of now.

Following is its...
Forum: Programming 03-05-2020
12,841
Posted By RavinderSingh13
Thanks a TON Neo for sharing this :b: It really...
Thanks a TON Neo for sharing this :b: It really helps to all of us who want to learn.

After getting inspired from you, highly, I too started, yesterday, and installed node-red in windows system...
Forum: What is on Your Mind? 03-04-2020
7,881
Posted By RavinderSingh13
Hello Neo, Thanks a TON for making this BOT,...
Hello Neo,

Thanks a TON for making this BOT, this is an awesome experience. I played it for 20 mins or so on Telegram.

It is FUN. Appreciate your dedication and hard work here; I wish I could...
3,118
Posted By RavinderSingh13
Hello shanul karim, Thank you for sharing...
Hello shanul karim,

Thank you for sharing your efforts in form of code in your question. Could you please do let us know more clearly what is the logic of getting the expected output. Honestly its...
13,732
Posted By RavinderSingh13
Hello All, Learnt an example of Lazy match...
Hello All,

Learnt an example of Lazy match in Regex in Perl, so thought to share here.
Let's say following is Input_file.


cat Input_file
abcdtest123^ DUMMYtestabcd12234 DUMMY bla...
4,483
Posted By RavinderSingh13
Hello nez, How about this one then? I am...
Hello nez,

How about this one then? I am sorry I couldn't test it since I don' have my logged into any server so tested on a online editor with 2 lines. Pretty sure should be faster :)


xargs...
13,732
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
13,732
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? 02-11-2020
7,438
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...
2,119
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...
6,151
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)
}
}
' ...
14,114
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 01-29-2020
6,650
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,...
13,171
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.
...
3,527
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? 01-24-2020
9,371
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...
5,891
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...
2,153
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...
2,153
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' ...
24,207
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...
3,093
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
3,416
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...
12,997
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,...
Showing results 1 to 25 of 500

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