Sponsored Content
Full Discussion: Expr strange problem to me
Top Forums Shell Programming and Scripting Expr strange problem to me Post 302287552 by Revansing on Saturday 14th of February 2009 05:21:17 AM
Old 02-14-2009
Expr strange problem to me

Hi all,

Please help me solve below issue.

expr 04170000000 + 1 gives me -124967295 and offcourse I want this to be 04170000001

and it happens for some sort of number like some other
02300000000
02600000000
03800000000
I guess after exceeding certain range it is converting it somewhere somehow format dont know.

IIf you have any Idea that would be great. or any alternative way of acheiving it using awk etc do pass it.

Thanks,
Revansing.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

strange...problem

Hi.. Some of my application were not running properly due to lack of virtual memory.....so wht i did add one free harddisk as swap file system...and increased the swap memory.. But since than my root file system is showing 100% full thr is no space left...is thr any link between these two..... (1 Reply)
Discussion started by: Prafulla
1 Replies

2. Linux

very strange problem

I have installed Fedora Core on a Toshiba Satellite Pro4600 laptop recently I have experienced a rather mysterious problem if I touch anything specially the keyboard or mouse I see this stuff “67yujhnmyyy” straight away some time it won't stop for while like this... (5 Replies)
Discussion started by: kemobyte
5 Replies

3. Shell Programming and Scripting

Strange problem

I am using SunOS 5.9 and I don't know why all my commands are getting executed as if an extra 'enter' has been pressed. What could be the reason and how to correct it? Please help. Asty (2 Replies)
Discussion started by: Asty
2 Replies

4. Shell Programming and Scripting

expr problem

Hi, in my ksh script expr 22 / 10 results as 2 but the actual result expected in 2.2. how do i get that result. Please help Thanks, (2 Replies)
Discussion started by: kotasateesh
2 Replies

5. UNIX for Dummies Questions & Answers

expr problem

Hi, in my ksh script expr 22 / 10 results as 2 but the actual result expected in 2.2. how do i get that result. Please help Thanks, (4 Replies)
Discussion started by: kotasateesh
4 Replies

6. UNIX for Dummies Questions & Answers

problem with expr command

:) hi Unix gurus, Pls consider the following piece of code str='hello' length=echo $str|wc -c echo $length y= ` expr \( 80 - $length \) ` echo $y :confused: The last echo stmt is displaying 0 as the result. If i put direct value like 6 instead of $length in i 3rd stmt it is giving... (8 Replies)
Discussion started by: ravi raj kumar
8 Replies

7. Shell Programming and Scripting

Strange problem.

Well, my script started off to do what i wanted. Now, i think its not recognizing the pattern so its not moving anything. What i have to do is execute my script command for the move to take effect. So i did that and yayy it worked. Strange thing is that my DESTDIR was empty to begin with.... (2 Replies)
Discussion started by: oxoxo
2 Replies

8. Shell Programming and Scripting

Expr problem and other basic problems

Hello, I am new to the Bash scripting language, and was given a tutorial page on how to setup a file. However I am trying to use cygwin to run this file and it is not working. $ vi averagetime.sh # # # echo "Enter Dictorinary File Text " read dict echo "Enter Grid Name" read grid... (13 Replies)
Discussion started by: killerqb
13 Replies

9. Shell Programming and Scripting

strange problem

hello all, i am having problem in accessing a directory.I dont think its a permission issue.can anyone help me out. I am using korn sell code: $ ls -ltr sc* lrwxrwxrwx 1 essbase essbase 21 Oct 8 2010 sc_ssp -> /work/nfs/nas2/sc_ssp $ cd sc_ssp ksh: sc_ssp: not found $ (6 Replies)
Discussion started by: manid
6 Replies

10. Shell Programming and Scripting

Problem with expr command in shell script

Hi, I have used expr command to increment the date. for e.g., case 1 : echo $(date -d $(echo `expr 20010101 + 1`)) it returns Tue Jan 2 00:00:00 IST 2001 case 2: echo $(date -d $(echo `expr 20010101 - 1`)) it returns date: invalid date `20010100' please suggest me, how to... (3 Replies)
Discussion started by: nanthagopal
3 Replies
Imager::Expr(3pm)					User Contributed Perl Documentation					 Imager::Expr(3pm)

NAME
Imager::Expr - implements expression parsing and compilation for the expression evaluation engine used by Imager::transform2() SYNOPSIS
my $code = Imager::Expr->new({rpnexpr=>$someexpr}) or die "Cannot compile $someexpr: ",Imager::Expr::error(); DESCRIPTION
This module is used internally by the Imager::transform2() function. You shouldn't have much need to use it directly, but you may want to extend it. To create a new Imager::Expr object, call: my %options; my $expr = Imager::Expr->new(\%options) or die Imager::Expr::error(); You will need to set an expression value and you may set any of the following: o constants A hashref defining extra constants for expression parsing. The names of the constants must be valid identifiers (/[^Wd]w*/) and the values must be valid numeric constants (that Perl recognizes in scalars). Imager::Expr may define it's own constants (currently just pi.) o variables A reference to an array of variable names. These are allocated numeric registers starting from register zero. By default you can define a "rpnexpr" key (which emulates RPN) or "expr" (an infix expression). It's also possible to write other expression parsers that will use other keys. Only one expression key should be defined. Instance methods The Imager::Expr::error() method is used to retrieve the error if the expression object cannot be created. Methods Imager::Expr provides only a few simple methods meant for external use: Imager::Expr->type_registered($keyword) Returns true if the given expression type is available. The parameter is the key supplied to the new() method. if (Imager::Expr->type_registered('expr')) { # use infix expressions } $expr->code() Returns the compiled code. $expr->nregs() Returns a reference to the array of numeric registers. $expr->cregs() Returns a reference to the array of color registers. $expr->dumpops() Returns a string with the generated VM "machine code". $expr->dumpcode() Returns a string with the disassembled VM "machine code". Creating a new parser I'll write this one day. Methods used by parsers: compile This is the main method you'll need to implement in a parser. See the existing parsers for a guide. It's supplied the following parameters: o $expr - the expression to be parsed o $options - the options hash supplied to transform2. Return an array ref of array refs containing opcodes and operands. @vars = $self->_variables() A list (not a reference) of the input variables. This should be used to allocate as many registers as there are variable as input registers. $self->error($message) Set the return value of Imager::Expr::error() @ops = $self->stack_to_reg(@stack_ops) Converts marginally parsed RPN to register code. assemble() Called to convert op codes into byte code. numre() Returns a regular expression that matches floating point numbers. optimize() Optimizes the assembly code, including attempting common subexpression elimination and strength reducing division by a constant into multiplication by a constant. register_type() Called by a new expression parser implementation to register itself, call as: YourClassName->register_type('type code'); where type code is the parameter that will accept the expression. Future compatibility Try to avoid doing your own optimization beyond literal folding - if we add some sort of jump, the existing optimizer will need to be rewritten, and any optimization you perform may well be broken too (well, your code generation will probably be broken anyway <sigh>). perl v5.14.2 2011-06-06 Imager::Expr(3pm)
All times are GMT -4. The time now is 01:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy