Search Results

Search: Posts Made By: balajesuri
229
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...
782
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
449
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
3,662
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...
295
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,367
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,363
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,153
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,217
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
821
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)
201
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,521
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
812
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)
240
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...
580
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 :)
607
Posted By balajesuri
Do you have this module IO::Tty...
Do you have this module IO::Tty (https://metacpan.org/pod/IO::Tty) installed?
228
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 =...
476
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...
365
Posted By balajesuri
Hello, what have you tried? :-) Here are...
Hello, what have you tried? :-)

Here are some pointers to help you get started:
1. ls -rt | tail -1 to get the last image.
2. Check if it's an image file (and not a dir or symlink, for instance)...
843
Posted By balajesuri
You can create a virtual stack in your mind and...
You can create a virtual stack in your mind and then read through the code. Everytime there's an if, you make a push; and everytime there's a fi, you make a pop from that virtual stack. At the end of...
Forum: Programming 03-09-2018
1,065
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...
450
Posted By balajesuri
It could also be a good start to learn python...
It could also be a good start to learn python programming language and explore numpy (http://www.numpy.org/).
474
Posted By balajesuri
#! /usr/bin/zsh query="set pagesize 0...
#! /usr/bin/zsh

query="set pagesize 0 feedback off verify off heading off echo off;
select table_name, table_name1 from table;"

while read line
do
table_name=$(echo $line | awk '{print...
558
Posted By balajesuri
You may use simple shell techniques (reading file...
You may use simple shell techniques (reading file line by line, grep, sed/cut, output redirection) to achieve this; or go for bit more advanced techniques provided by, let's say python's xml modules...
736
Posted By balajesuri
find /path/to/parent/dir -type f -exec cp {}...
find /path/to/parent/dir -type f -exec cp {} /path/to/new/dir \;
Showing results 1 to 25 of 500

 

Featured Tech Videos

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