Sponsored Content
Top Forums Shell Programming and Scripting Problem in algebraic substraction Post 302629941 by sagar_1986 on Wednesday 25th of April 2012 08:18:56 AM
Old 04-25-2012
Error Problem in algebraic substraction

my code is like this


Code:
count=`cat /filecount.txt | tail -1 |head -1| awk '{print $1}'`  ###file is having value 264  ####

echo "actual count = $count"

exact_count=`expr $value \* 24`

echo "exact_count= $exact_count"

diff=`expr "$exact_count" - "$count"`

a= exact_count - count

echo " value is &a"
echo "$diff"

but it is showing following error




Code:
actual count = 264
exact_count= 264
expr: An integer value was expected.

temp[55]: exact_count:  not found.
 value is &a

temp[55]: exact_count:  not found.
 value is &a


Last edited by sagar_1986; 04-25-2012 at 09:35 AM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Date Substraction

In Unix script, how to get a "date - 1" ie, yesterday? (4 Replies)
Discussion started by: AC
4 Replies

2. Solaris

Substraction in bash

Hi all, I have in one script something like this: FIRSTOCC=`grep -n ORA- alert_bill2.log |tail -"$ROWS"|head -1|cut -d: -f1` TOTAL=`more alert*|wc -l` DIFFERENCE=`$TOTAL-$FIRSTOCC` echo Total lines in alert_bill = $TOTAL echo $DIFFERENCE How do I make this substraction work? Thk (2 Replies)
Discussion started by: mclaudiu
2 Replies

3. AIX

user login problem & Files listing problem.

1) when user login to the server the session got colosed. How will resolve? 2) While firing the command ls -l we are not able to see the any files in the director. but over all view the file system using the command df -g it is showing 91% used. what will be the problem? Thanks in advance. (1 Reply)
Discussion started by: pernasivam
1 Replies

4. Shell Programming and Scripting

date substraction

hello i have obtained the current date .. current_date=date "+%m/%d%y" and i have another date ,stored in my log file which i have already retrieved. i want to store the subtraction in a varible called diff. diff=log_date - currentdate ex: log_date=01/28/11 current_date=... (3 Replies)
Discussion started by: urfrnddpk
3 Replies

5. Shell Programming and Scripting

problem in algebraic expression

count=`cat /filecount.txt | tail -1 |head -1| awk '{print $1}'` exact_count=`expr $value \* 24` i want to subtract a="$exact_count" - "$count" but its not taking o/p of "count" as number $a is wrong answer hence not getting proper output. plz help me out :confused: Please use... (3 Replies)
Discussion started by: sagar_1986
3 Replies

6. Shell Programming and Scripting

Try solver System of linear algebraic equations in Shell Bash

I want to try solving system of linear algebraic equations in Shell bash but i have any problems Value input is matrix and I dont know how to input matrix in Shell because that is dont support 2-dimensional array Please help me. Thank you so much (3 Replies)
Discussion started by: newbieseos
3 Replies

7. Shell Programming and Scripting

Substraction in shell scripting

Hello friends, I am new on linux, i am facing issues on below script. #!/bin/sh current=1355147377 echo $current last_modified=1354537347 echo $last_modified DIFF='expr ($current - $last_modified)' echo $DIFF Please view this code tag video for how to use code tags when posting... (8 Replies)
Discussion started by: sanjay833i
8 Replies

8. Shell Programming and Scripting

awk - sed / reading from a data file and doing algebraic operations

Hi everyone, I am trying to write a bash script which reads a data file and does some algebraic operations. here is the structure of data.xml file that I have; 1 <data> 2 . 3 . 4 . 5 </data> 6 <data> 7 . 8 . 9 . 10</data> etc. Each data block contains same number of lines (say... (4 Replies)
Discussion started by: hayreter
4 Replies

9. Shell Programming and Scripting

Substraction of matching lines from a file.

I have 2 files: file1.txt contains /html/mybook/Charts/143712/reptiles.pdf /html/mybook/Charts/198459/spices.pdf /html/mybook/Charts/198459/fresh_nuts.pdf /html/mybook/Charts/123457/dome_anim.pdf /html/mybook/Charts/123457/vegetables.pdf /html/content/3DInteractive/174091/CSPSGGB.html ... (6 Replies)
Discussion started by: Jojan Paul
6 Replies
ppmtosixel(1)                                                 General Commands Manual                                                ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 05:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy