Sponsored Content
Full Discussion: Code optimization
Top Forums Shell Programming and Scripting Code optimization Post 303018805 by wisecracker on Friday 15th of June 2018 12:09:37 PM
Old 06-15-2018
Hi primo102...

Just an observation and slightly off topic and assumes bash.
I have no idea which OS you are using but there are now various Linux flavours that use terminal __windows__ of varying sizes.
I am assuming that you are using the standard size of 80x24, however.....
I have seen 60x21 - (the smallest I have seen), 70x23, 77x25, 80x25 and a couple of others.
Some of the default terminal windows inside certain Linux flavours will not be able to be resized on the fly, the 60x21 one was just an example, so you might have to work around those limits!
You can check yours by using stty size and this will give the figures in reverse, something like 24 80 ...
For those terminal windows that CAN be resized on the fly you can use this at the start of your script after the "shebang":
Code:
printf "%b" "\x1B[8;24;80t"

If you really want to make it pretty some of these terminal windows can even be written into the title bar:
Code:
printf "%b" "\x1B]0;Your title bar text here.\x07"

And return back to default title:
Code:
printf "%b" "\x1B]0;\x07"

Again, purely just an observation as you are using a neatly ordered selection process.
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help on optimization of the script

Hi, I have prepared script which is taking more time to process. find below script and help me with fast optimized script:- cat name.txt | while read line do name=$(echo $line| awk '{print $8}') MatchRecord=$(grep $name abc.txt | grep -v grep ) echo "$line | $MatchRecord" | awk... (2 Replies)
Discussion started by: aju_kup
2 Replies

2. Programming

compilation parameters, code optimization

Hi all, I implemented an application, through using c++ and compiled it with g++. At first, what I did is (@ compilation): g++ calcBacon.C -o test -DDEBUG after I ran my application it took almost 120 sec. to finish its execution when I compiled with optimization parameters, execution... (5 Replies)
Discussion started by: SaTYR
5 Replies

3. Shell Programming and Scripting

script optimization

:o Hi, I am writing a script in which at some time, I need to get the process id of a special process and kill it... I am getting the PID as follows... ps -ef | grep $PKMS/scripts | grep -v grep | awk '{print $2 }'can we optimize it more further since my script already doing lot of other... (3 Replies)
Discussion started by: vivek.gkp
3 Replies

4. UNIX for Dummies Questions & Answers

unix script optimization

I have a file which contains 9,200,000. It contains 125 clolumns. I have to rearrange some columns and exclude some of them. I scripted the following script to do the same. It is working fine but it is taking more than 4hrs to do it. can it be optmized. Here is the script LOC="/sourcefile/"... (3 Replies)
Discussion started by: max_payne1234
3 Replies

5. Shell Programming and Scripting

AWK optimization

Hello, Do you have any tips on how to optimize the AWK that gets the lines in the log between these XML tags? se2|6|<ns1:accountInfoRequest xmlns:ns1="http://www.123.com/123/ se2|6|etc2"> .... <some other tags> se2|6|</ns1:acc se2|6|ountInfoRequest> The AWK I'm using to get this... (2 Replies)
Discussion started by: majormark
2 Replies

6. Shell Programming and Scripting

sed optimization

I have a process using the following series of sed commands that works pretty well. sed -e 1,1d $file |sed 1i\\"EHLO Broadridge.com" |sed 2i\\"MAIL FROM:${eaddr}"|sed 3i\\"RCPT TO:${eaddr}"|sed 4i\\"DATA"|sed 5s/.FROM/FROM:/|sed 6s/.TO/TO:/|sed 7,7d|sed s/.ENDDATA/./|sed s/.ENDARRAY// >temp/$file... (1 Reply)
Discussion started by: njaiswal
1 Replies

7. Programming

Make file optimization

Hi , I need some help on optmizing the make file. I have the below scenario. SOUTHERN_XITEM_PROGS=\ sfmxitem.rel \ sfqxitem.rel SOUTHERN_XITEM_DEPS= southern_xitem.c SUPERSVU_XITEM_PROGS=\ su3xitem.rel SUPERSVU_XITEM_DEPS= supersvu_xitem.c $(SOUTHERN_XITEM_PROGS) : $$@.o... (1 Reply)
Discussion started by: angelinrajeesha
1 Replies

8. Shell Programming and Scripting

CPU optimization

hi guys , I have 10 scripts suppose 1.sh , 2.sh ,3.sh ,4.sh ......10.sh each takes some time ( for instance 2 minutes to 40 minutes ) my server can run around 3-4 files at a time suppose, 1.sh , 2.sh , 3.sh are running currently now as soon as ANY ONE of the gets finished i... (4 Replies)
Discussion started by: Gl@)!aTor
4 Replies
CUBRID_ERROR(3) 							 1							   CUBRID_ERROR(3)

cubrid_error - Get the error message

SYNOPSIS
string cubrid_error ([resource $connection]) DESCRIPTION
The cubrid_error(3) function is used to get the error message that occurred during the use of CUBRID API. Usually, it gets error message when API returns false as its return value. PARAMETERS
o $connection -The CUBRID connection. RETURN VALUES
Error message that occurred. EXAMPLES
Example #1 cubrid_error(3) example <?php $con = cubrid_connect('localhost', 33000, 'demodb', 'dba', ''); $req = cubrid_execute($con, "select id, name from person"); if ($req) { while (list ($id, $name) = cubrid_fetch($req)) echo $id, $name; } else { echo "Error Code: ", cubrid_errno($con); echo "Error Message: ", cubrid_error($con); } ?> The above example will output: Error Code: -493 Error Message: Syntax: Unknown class "person". select id, [name] from person SEE ALSO
cubrid_errno(3), cubrid_error_code(3), cubrid_error_msg(3). PHP Documentation Group CUBRID_ERROR(3)
All times are GMT -4. The time now is 10:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy