Search Results

Search: Posts Made By: balajesuri
Forum: Shell Programming and Scripting 3 Weeks Ago
1,226
Posted By balajesuri
Hint: find /path/to/search \( -iname '*.jpg' -o...
Hint:
find /path/to/search \( -iname '*.jpg' -o -iname '*.tif' \)
Forum: Shell Programming and Scripting 3 Weeks Ago
1,334
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.
633
Posted By balajesuri
if [[ $reply2 == "A" ]]; then Exe_Cmd_State ...
if [[ $reply2 == "A" ]]; then
Exe_Cmd_State
Analysis_Cmd_state
elif [[ $reply2 == "B" ]]; then
else
echo "Not valid Option"
fi


Don't the lines in red look shady to you? :D
Forum: Programming 3 Weeks Ago
532
Posted By balajesuri
I see that "text" is basically a dictionary. So...
I see that "text" is basically a dictionary. So you can convert the object type from str to dict; loop over the keys and print only the key-value pairs you need.
541
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
2,185
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
2,008
Posted By balajesuri
...and learned a lot along the way :) Thanks for...
...and learned a lot along the way :) Thanks for the efforts.
1,101
Posted By balajesuri
1/ The first thing I observed is that you're...
1/
The first thing I observed is that you're doing
for var in `cat filename`
do
...
done
instead of
while read line
do
...
done < filename



2/
Next I see that in the inner loop...
1,224
Posted By balajesuri
Why not use awks' own printf? - Printf Examples...
Why not use awks' own printf? - Printf Examples (The GNU Awk User’s Guide) (https://www.gnu.org/software/gawk/manual/html_node/Printf-Examples.html)
Forum: Programming 11-04-2019
1,717
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
6,907
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...
625
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...
2,896
Posted By balajesuri
On GNU bash, version 4.4.12 $ echo...
On GNU bash, version 4.4.12



$ echo ${text:1:-1}
001E:001F,,,02EE,0FED:0FEF
1,639
Posted By balajesuri
1. Could you please show what you have tried? ...
1. Could you please show what you have tried?

2. Please understand that forum members may not have working knowledge of biology. So when you say, "Print out the number of occurrences for each...
1,433
Posted By balajesuri
| sed 's/\(\([0-9A-F][0-9A-F] \)\{4\}\)/\1\n/g'
| sed 's/\(\([0-9A-F][0-9A-F] \)\{4\}\)/\1\n/g'
1,500
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,614
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)
324
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,821
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...
Forum: Programming 02-15-2019
1,136
Posted By balajesuri
You might want to start by reading the JAVA API...
You might want to start by reading the JAVA API documentation of File class:
File (Java Platform SE 7 ) (https://docs.oracle.com/javase/7/docs/api/java/io/File.html)
321
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...
828
Posted By balajesuri
Or an interesting exercise would be to convert...
Or an interesting exercise would be to convert your script to run on bourne shell, so that it works on all shells. Would be quite insightful to do so :)
840
Posted By balajesuri
Do you have this module IO::Tty...
Do you have this module IO::Tty (https://metacpan.org/pod/IO::Tty) installed?
301
Posted By balajesuri
This looks like a config file (or ini file) that...
This looks like a config file (or ini file) that can be read by python's configparser module. Here's an attempt to comment out a section using python 3 interpreter.


import configparser

file =...
803
Posted By balajesuri
As per the OSX sed manual...
As per the OSX sed manual (https://ss64.com/osx/sed.html) (and the error message), you need to use a backslash and newline for a, i and c:
[1addr]i\
text
Write text to the...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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