Search Results

Search: Posts Made By: balajesuri
106,558
Posted By balajesuri
Hint: find /path/to/search \( -iname '*.jpg' -o...
Hint:
find /path/to/search \( -iname '*.jpg' -o -iname '*.tif' \)
73,671
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.
4,298
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
15,905
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
12,852
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
5,591
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
13,019
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...
7,316
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...
5,833
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
3,385
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)
3,515
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...
7,188
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...
2,347
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
2,129
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,837
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.
2,036
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
1,053
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,350
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
4,595
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...
14,800
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?
18,433
Posted By balajesuri
x="ABCD" n=10 n=$((n + ${#x})) printf...
x="ABCD"
n=10
n=$((n + ${#x}))
printf "%${n}s" $x
3,907
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
3,482
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:
4,497
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)
...
5,609
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...
Showing results 1 to 25 of 500

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