Sponsored Content
Top Forums UNIX for Dummies Questions & Answers converting string to number in shell script Post 302600845 by turki_00 on Wednesday 22nd of February 2012 08:40:43 AM
Old 02-22-2012
cat idsOutput

Commencing packet processing (pid=2103)
===============================================================================
Run time for packet processing was 1.3579 seconds
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell to number and to string

Hello Does the unix korn shell provide a function to convert between number and string data-types regards Hrishy (1 Reply)
Discussion started by: xiamin
1 Replies

2. Shell Programming and Scripting

need help converting string to number for calculation

I've searched the forum and google, but can't see an answer to this simple problem. Here's my small test script: #!/bin/csh echo "enter a number:" read num echo "you entered $num" set num = `expr $num + 1` echo new value is $num can someone show me how to do this calculation? note that... (4 Replies)
Discussion started by: tpatput
4 Replies

3. Shell Programming and Scripting

Converting Shell Script to HTML

Hi, Im new to shell scripting. My task is to convert shell script feed into html, so basically I have a lot of information in shell script and I want to convert it html. I know you can simply convert the information by hand, but is there any simpler way? Thank you Dave (3 Replies)
Discussion started by: davwel
3 Replies

4. Shell Programming and Scripting

Problem in converting number in shell script

Hi All, I am writing a shell script in which I want to convert a number like : Suppose the number is "98487657" and we have to convert it to "98000000", what I want to do is to retain first 2 digits and convert all remaining digits to "0". Number could be of any length (length... (4 Replies)
Discussion started by: amitanshu.verma
4 Replies

5. Shell Programming and Scripting

How to Check given string is number in shell script?

Hi, Can anyone help me out to check whether the input argument is number? Example: REQUEST_ID="123456" I need to check the REQUEST_ID value is number or string. Thanks in Advance Regards BS (6 Replies)
Discussion started by: balajiora
6 Replies

6. Shell Programming and Scripting

Shell Script to identify the line number containing a particular "string"

Hi, I have a log file, where i am required to identify the line number, where a particular string/line appears in the log file. And then copy 200 lines above that line number to a new file. Can someone provide pointers on how to write this script or what command to be used ? Any... (2 Replies)
Discussion started by: kk2202
2 Replies

7. Shell Programming and Scripting

Unix shell script converting temperatures.

:confused:Please I really need help with an assignment question. I need to write a script that will take the input from a file and convert the number from Centigrade(Celcius) to Fahrenheit or vice versa. Thank you so much. I really need it to be detailed. Please remember the input comes from a file. (1 Reply)
Discussion started by: starter101
1 Replies

8. Shell Programming and Scripting

Converting rows to columns using shell script

I have a script which converts rows to columns. file_name=$1 mailid=$2 #CREATE BACKUP OF ORIGINAL FILE #cp ${file_name}.xlsx ${file_name}_temp.xlsx #tr '\t' '|' < ${file_name}_temp.xlsx > ${file_name}_temp.csv #rm ${file_name}_temp.xlsx pivot_row=`head -1 ${file_name}` sed 1d... (3 Replies)
Discussion started by: andy538
3 Replies

9. Shell Programming and Scripting

Converting a shell script to program

Hi I am new in programming. I have written a shell code, but i want to secure my code. I have tried SHC. It is converting it to binary, but can be converted in plain text again by core dump. I have tried to convert it in rpm by "rpmbuild -bb my.spec" option but the result is same. ... (4 Replies)
Discussion started by: Priy
4 Replies

10. UNIX for Beginners Questions & Answers

Concatenate a string and number and compare that with another string in awk script

I have below code inside my awk script if ( $0 ~ /SVC IN:/ ) { svc_in=substr( $0,23 , 3); if (msg_start == 1 && msg_end == 0) { msg_arr=$0; } } else if ( $0 ~ /^SVC OUT:/ ) { svc_out=substr( $0, 9, 3); if (msg_start == 1 && msg_end == 0) ... (6 Replies)
Discussion started by: bhagya123
6 Replies
QwtScaleEngine(3)						 Qwt User's Guide						 QwtScaleEngine(3)

NAME
QwtScaleEngine - Base class for scale engines. SYNOPSIS
#include <qwt_scale_engine.h> Inherited by QwtLinearScaleEngine, and QwtLog10ScaleEngine. Public Types enum Attribute { NoAttribute = 0, IncludeReference = 1, Symmetric = 2, Floating = 4, Inverted = 8 } Public Member Functions int attributes () const virtual void autoScale (int maxNumSteps, double &x1, double &x2, double &stepSize) const =0 virtual QwtScaleDiv divideScale (double x1, double x2, int maxMajSteps, int maxMinSteps, double stepSize=0.0) const =0 double lowerMargin () const QwtScaleEngine () double reference () const void setAttribute (Attribute, bool on=true) void setAttributes (int) void setMargins (double lower, double upper) void setReference (double reference) bool testAttribute (Attribute) const virtual QwtScaleTransformation * transformation () const =0 double upperMargin () const virtual ~QwtScaleEngine () Protected Member Functions QwtDoubleInterval buildInterval (double v) const bool contains (const QwtDoubleInterval &, double val) const double divideInterval (double interval, int numSteps) const QwtValueList strip (const QwtValueList &, const QwtDoubleInterval &) const Detailed Description Base class for scale engines. A scale engine trys to find 'reasonable' ranges and step sizes for scales. The layout of the scale can be varied with setAttribute(). Qwt offers implementations for logarithmic (log10) and linear scales. Contributions for other types of scale engines (date/time, log2 ... ) are welcome. Member Enumeration Documentation enum QwtScaleEngine::Attribute .IP o 2 IncludeReference Build a scale which includes the reference() value. o Symmetric Build a scale which is symmetric to the reference() value. o Floating The endpoints of the scale are supposed to be equal the outmost included values plus the specified margins (see setMargins()). If this attribute is *not* set, the endpoints of the scale will be integer multiples of the step size. o Inverted Turn the scale upside down. See also: setAttribute(), testAttribute(), reference(), lowerMargin(), upperMargin() Constructor &; Destructor Documentation QwtScaleEngine::QwtScaleEngine () [explicit] Constructor. QwtScaleEngine::~QwtScaleEngine () [virtual] Destructor. Member Function Documentation int QwtScaleEngine::attributes () const Return the scale attributes See also: Attribute, setAttributes(), testAttribute() virtual void QwtScaleEngine::autoScale (intmaxNumSteps, double &x1, double &x2, double &stepSize) const [pure virtual] Align and divide an interval Parameters: maxNumSteps Max. number of steps x1 First limit of the interval (In/Out) x2 Second limit of the interval (In/Out) stepSize Step size (Return value) Implemented in QwtLinearScaleEngine, and QwtLog10ScaleEngine. QwtDoubleInterval QwtScaleEngine::buildInterval (doublev) const [protected] Build an interval for a value. In case of v == 0.0 the interval is [-0.5, 0.5], otherwide it is [0.5 * v, 1.5 * v] bool QwtScaleEngine::contains (const QwtDoubleInterval &interval, doublevalue) const [protected] Check if an interval 'contains' a value Parameters: interval Interval value Value See also: QwtScaleArithmetic::compareEps() double QwtScaleEngine::divideInterval (doubleintervalSize, intnumSteps) const [protected] Calculate a step size for an interval size Parameters: intervalSize Interval size numSteps Number of steps Returns: Step size virtual QwtScaleDiv QwtScaleEngine::divideScale (doublex1, doublex2, intmaxMajSteps, intmaxMinSteps, doublestepSize = 0.0) const [pure virtual] Calculate a scale division. Parameters: x1 First interval limit x2 Second interval limit maxMajSteps Maximum for the number of major steps maxMinSteps Maximum number of minor steps stepSize Step size. If stepSize == 0.0, the scaleEngine calculates one. Implemented in QwtLinearScaleEngine, and QwtLog10ScaleEngine. double QwtScaleEngine::lowerMargin () const Returns: the margin at the lower end of the scale The default margin is 0. See also: setMargins() double QwtScaleEngine::reference () const Returns: the reference value See also: setReference(), setAttribute() void QwtScaleEngine::setAttribute (Attributeattribute, boolon = true) Change a scale attribute Parameters: attribute Attribute to change on On/Off See also: Attribute, testAttribute() void QwtScaleEngine::setAttributes (intattributes) Change the scale attribute Parameters: attributes Set scale attributes See also: Attribute, attributes() void QwtScaleEngine::setMargins (doublelower, doubleupper) Specify margins at the scale's endpoints. Parameters: lower minimum distance between the scale's lower boundary and the smallest enclosed value upper minimum distance between the scale's upper boundary and the greatest enclosed value Margins can be used to leave a minimum amount of space between the enclosed intervals and the boundaries of the scale. Warning: o QwtLog10ScaleEngine measures the margins in decades. See also: upperMargin(), lowerMargin() void QwtScaleEngine::setReference (doubler) Specify a reference point. Parameters: r new reference value The reference point is needed if options IncludeReference or Symmetric are active. Its default value is 0.0. See also: Attribute QwtValueList QwtScaleEngine::strip (const QwtValueList &ticks, const QwtDoubleInterval &interval) const [protected] Remove ticks from a list, that are not inside an interval Parameters: ticks Tick list interval Interval Returns: Stripped tick list bool QwtScaleEngine::testAttribute (Attributeattribute) const Check if a attribute is set. Parameters: attribute Attribute to be tested See also: Attribute, setAttribute() virtual QwtScaleTransformation* QwtScaleEngine::transformation () const [pure virtual] Returns: a transformation Implemented in QwtLinearScaleEngine, and QwtLog10ScaleEngine. double QwtScaleEngine::upperMargin () const Returns: the margin at the upper end of the scale The default margin is 0. See also: setMargins() Author Generated automatically by Doxygen for Qwt User's Guide from the source code. Version 5.2.2 Mon Aug 1 2011 QwtScaleEngine(3)
All times are GMT -4. The time now is 04:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy