Sponsored Content
Full Discussion: Subtract two variable
Top Forums Shell Programming and Scripting Subtract two variable Post 302773453 by pamu on Thursday 28th of February 2013 02:14:37 AM
Old 02-28-2013
try sth like this..


Code:
awk 'NR==3{A=$0}
	FNR==3 && NR > 3{B=$0}
	END{print (B-A)/(1024*1024)}' /tmp/size_info_old.out /tmp/size_info.out

This User Gave Thanks to pamu For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Subtract Time

Hello, Im writing a script using the ksh shell. I have 2 variables in the script: CURRTIME PREVTIME Example, if CURRTIME=13:00, I want to somehow calculate what the time was an hour ago so that PREVTIME=12:00 Right now I have the following: CURRTIME=`date +%H:%M` How can I... (4 Replies)
Discussion started by: xadamz23
4 Replies

2. UNIX for Advanced & Expert Users

Subtract 2 months from the date

I have the script which appends month and year to the name of the file. Now every time when I append the month-year combination I have to subtract 2 months from the current date and then append it, since we are sending our vendor 2 months prior worth of data eveytime. #! /usr/bin/ksh ... (5 Replies)
Discussion started by: mahekr2000
5 Replies

3. Shell Programming and Scripting

Subtract days from a variable holding date

Hi, could someone help on this.. I have a date in variable procdate="05/30/2009" I would want to Subtract it with 3 or 4 (2 Replies)
Discussion started by: infernalhell
2 Replies

4. Shell Programming and Scripting

how to subtract variables

i have var1=abc def var2=abc I want to do var1-var2 ie i want def how can i do it? Thanks please help (1 Reply)
Discussion started by: javaholics
1 Replies

5. Shell Programming and Scripting

Script to subtract rows HELP

Dear All, Please help with a script which can accomplish the following: Input table: $1 $2 $3 Student1 1 50 Student2 56 75 Student3 77 100 Desired Output: $1 $2 $3 $4 Student1 1 50 Student2 56 75 6 Student3 77 ... (4 Replies)
Discussion started by: saint2006
4 Replies

6. Shell Programming and Scripting

Help need to subtract the data from 2 columns

space_used.lst /dev/vx/dsk/A06487-S01-c4e3s-ORACLE-dg/oradata01 505G 318G 175G 65% /dborafiles/nethealth21/PV/oradata01 /dev/vx/dsk/A06487-S01-c4e3s-ORACLE-dg/oradata02 505G 433G 67G 87% /dborafiles/nethealth21/PV/oradata02 /dev/vx/dsk/A06487-S01-c4e3s-ORACLE-dg/oradata03 507G 422G 79G 85%... (4 Replies)
Discussion started by: sathik
4 Replies

7. Shell Programming and Scripting

Script to subtract time stored in a variable

Hello, I am writing a script to find time difference between two timestamp stored in a variable. i have two variable t1=11:48:30 t2=13:13:48 how i can find the difference i.e t2-t1 in seconds. Please help (4 Replies)
Discussion started by: anand2308
4 Replies

8. Shell Programming and Scripting

Add or Subtract the hours,minutes or seconds in the the time variable

Hello All, I am working on script where I need to add hours,minutes or seconds in the time.Time is not the current but it could be future time.I thought I can store that time in variable and add hours.minutes or second but I am not able to add that in the time that is stores in a variable. Time... (9 Replies)
Discussion started by: anuragpgtgerman
9 Replies

9. Shell Programming and Scripting

Match and subtract two fields

Not sure quite how to do this, but I am trying to use $1 of LCH.txt (exact match) to look for a match in $1 of genes.txt. If a match is found then in a new file match.txt $1 $2 ($4-$3) are copied. Example, the first record in LCH is PPT1 and that matches row 713, column 1 of genes.txt. ... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. Shell Programming and Scripting

Subtract time in two line

INPUT: 16:45:51 10051 77845 16:45:51 10051 77845 16:46:52 10051 77846 16:46:53 10051 77846 Match the last PID then subtract second line time with first line. Please help me with any command or script. (3 Replies)
Discussion started by: vivekn
3 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 06:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy