Search Results

Search: Posts Made By: balajesuri
46,600
Posted By balajesuri
You may try perl. When it comes to regex and...
You may try perl. When it comes to regex and string parsing, perl handles them beautifully. Of course, doesn't mean you don't have other options.
63,917
Posted By balajesuri
Hint: find /path/to/search \( -iname '*.jpg' -o...
Hint:
find /path/to/search \( -iname '*.jpg' -o -iname '*.tif' \)
37,489
Posted By balajesuri
This adds 5 hours to current time. perl -e...
This adds 5 hours to current time.
perl -e '$x=localtime(time+(5*3600));print $x'
1,759
Posted By balajesuri
Of course with -F flag: awk -F, '!a[$1]++' file
Of course with -F flag:
awk -F, '!a[$1]++' file
Forum: What is on Your Mind? 01-24-2020
9,440
Posted By balajesuri
Way to go Ravinder and Victor! You deserve it :)
Way to go Ravinder and Victor! You deserve it :)
Forum: What is on Your Mind? 12-26-2019
7,806
Posted By balajesuri
...and learned a lot along the way :) Thanks for...
...and learned a lot along the way :) Thanks for the efforts.
Forum: Programming 11-04-2019
4,033
Posted By balajesuri
Since you're using python3, you can also take...
Since you're using python3, you can also take advantage of string formatting:


'https://www.meihoski.co.jp/movie/{}'.format(a['href'])

Check this out: 6.1. string — Common string operations —...
Forum: Programming 09-05-2019
11,176
Posted By balajesuri
Minor edit
1. Read the file "SHA256" line by line in a loop. (for line in filehandle)

2. Tokenise each line as you read - the result will be stored in a list (hint: split after you strip)

3. The last item...
3,827
Posted By balajesuri
I think OP is asking for side by side printing of...
I think OP is asking for side by side printing of the output of two python scripts as they run, and has shown as an example, concatenation of two text files using izip_longest().


@bigvito19...
3,301
Posted By balajesuri
grep -P -B 10 -A 9 'Status: ...
grep -P -B 10 -A 9 'Status: (?!Clear)' alarm.txt
Forum: Programming 07-25-2019
2,569
Posted By balajesuri
A more pythonic way ;) N =...
A more pythonic way ;)



N = int(input("Please enter number:"))
t = sum([int(input("Enter Numbers %d:" %i)) for i in range(1, N+1)])
print(t)
1,316
Posted By balajesuri
I think your set -x gives pretty clear idea that...
I think your set -x gives pretty clear idea that "srvctl config database...." is not having any output. So $STANDBY_CONF is empty.
May be you want to check by running this command directly on...
4,667
Posted By balajesuri
Best place to start is the AWK manual: The GNU...
Best place to start is the AWK manual: The GNU Awk User’s Guide (https://www.gnu.org/software/gawk/manual/gawk.html)
Then you need lot of patience, practice, reading forums like this one and think...
1,327
Posted By balajesuri
Few simple modifications: #!/bin/bash ...
Few simple modifications:



#!/bin/bash

VarSize=${1-5} # use $1 if defined, else set VarSize as 5
OptSize=${2-3} # use $2 if defined, else set OptSize as 3
HomeSize=${3-2} # use $3 if...
Forum: Programming 03-09-2018
1,613
Posted By balajesuri
In a class, if you declare a method as static,...
In a class, if you declare a method as static, you need not instantiate the class to be able to use the method. So , in your program, the method change() is being called directly by qualifying it...
1,327
Posted By balajesuri
I'm not sure if this is a rule. But I generally...
I'm not sure if this is a rule. But I generally write the functions before i call them. Can you try putting panel() before execute() and run your code.
1,619
Posted By balajesuri
If you know the first and last ID, why not...
If you know the first and last ID, why not generate the sequence yourself:
[user@host ~]$ seq -f "RETT-%.0f" 1 5
RETT-1
RETT-2
RETT-3
RETT-4
RETT-5
854
Posted By balajesuri
Please let us know which OS you're using. It is...
Please let us know which OS you're using. It is important for this question because on most *nix flavours, the creation time is not stored in filesystem.

On windows, you can use...
5,639
Posted By balajesuri
#! /usr/bin/perl -w use strict; my...
#! /usr/bin/perl -w
use strict;

my ($x_bar, $x_sd, $y_bar, $y_sd, $i, $numerator, $r);
my (@f1_data, @f2_data);

open F1, "< file1";
for (<F1>) {
push (@f1_data, (split /\s+/)[2]);
}...
3,489
Posted By balajesuri
awk -F "," '$8 < 0{$8=$8*-1} {sum+=$8} END...
awk -F "," '$8 < 0{$8=$8*-1} {sum+=$8} END {printf "%.2f\n", sum}' file
3,391
Posted By balajesuri
1. To loop over the files matching a particular...
1. To loop over the files matching a particular pattern in a given directory, you can use the for (http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-7.html) loop construct. For e.g.,
for file in *.log
do...
11,926
Posted By balajesuri
Merely posting that there are errors is not...
Merely posting that there are errors is not helping much.

What errors do you get on running this script?
What did you understand from the errors?
16,689
Posted By balajesuri
x="ABCD" n=10 n=$((n + ${#x})) printf...
x="ABCD"
n=10
n=$((n + ${#x}))
printf "%${n}s" $x
3,188
Posted By balajesuri
Use for-loop. But I suppose you would want to...
Use for-loop. But I suppose you would want to change the email body and subject per attachment. I leave it to you to figure it out.

for ATTACHMENT_FILE in /path/to/folder/* # assuming folder has...
Forum: What is on Your Mind? 07-22-2016
2,132
Posted By balajesuri
Thanks for sharing knowledge with all of us....
Thanks for sharing knowledge with all of us. Indeed, it's a great selfless service. You rock! :):b:
Showing results 1 to 25 of 500

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