Search Results

Search: Posts Made By: balajesuri
Forum: What is on Your Mind? 2 Days Ago
285
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? 4 Weeks Ago
665
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
904
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
5,418
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...
324
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...
1,266
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
1,292
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)
214
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...
2,689
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...
256
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,074
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...
629
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.
773
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
373
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...
4,108
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]);
}...
763
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
1,999
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...
1,308
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?
4,265
Posted By balajesuri
x="ABCD" n=10 n=$((n + ${#x})) printf...
x="ABCD"
n=10
n=$((n + ${#x}))
printf "%${n}s" $x
1,765
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
1,345
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:
779
Posted By balajesuri
[user@host ~]$ cat test.sh #! /usr/bin/bash ...
[user@host ~]$ cat test.sh
#! /usr/bin/bash

file=$1
logfile="file"

in_dt=$(grep "PUT.*$file" $logfile | cut -d' ' -f1,2)
out_dt=$(grep "DELETE.*$file" $logfile | cut -d' ' -f1,2)
...
2,847
Posted By balajesuri
use sed -i [user@host ~]$ cat file hello ...
use sed -i

[user@host ~]$ cat file
hello
world
[user@host ~]$ sed '1s/..//' file
llo
world
[user@host ~]$ sed -i '1s/..//' file
[user@host ~]$ cat file
llo
world
[user@host ~]$
2,847
Posted By balajesuri
sed -i basically uses a tmp file and then...
sed -i basically uses a tmp file and then renames it to the original file. You could do the same. So, send the output to a new temp file. Rename the tmp file to original file.

sed '1s/^..//' file...
592
Posted By balajesuri
l=$(wc -l file | cut -d' ' -f1); sed "3,$(( l-1...
l=$(wc -l file | cut -d' ' -f1); sed "3,$(( l-1 ))s/.*UsageData.*//" file
Showing results 1 to 25 of 500

 

Featured Tech Videos

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