Search Results

Search: Posts Made By: balajesuri
47,706
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.
65,629
Posted By balajesuri
Hint: find /path/to/search \( -iname '*.jpg' -o...
Hint:
find /path/to/search \( -iname '*.jpg' -o -iname '*.tif' \)
37,537
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,871
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,714
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,977
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,106
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,250
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,990
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,379
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,613
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,373
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,822
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,356
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,647
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,358
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,635
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
864
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,651
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,531
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,447
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...
12,034
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,796
Posted By balajesuri
x="ABCD" n=10 n=$((n + ${#x})) printf...
x="ABCD"
n=10
n=$((n + ${#x}))
printf "%${n}s" $x
3,211
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,166
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 11:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy