10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I've this following text file
FileVersion = 1.03
Filetype = meteo_on_curvilinear_grid
TIME = 0 hours since 2016-10-03 12:00:00 +00:00
-6.855 -6.828 -6.801 -6.774 -6.747 -6.719 -6.691 -6.663 -6.634 -6.606 -6.577 -6.548 -6.519 -6.489
TIME = 0 hours since... (2 Replies)
Discussion started by: xisan
2. Shell Programming and Scripting
Here is the script i try to perform arithmetic operation in two variables .
git branch -r | while read brname ; do
REV_COMMITS=`git rev-list --count $brname`
echo "$brname has $REV_COMMITS"
(( TOTAL = TOTAL + REV_COMMITS ))
echo "in loop" $TOTAL
echo "total is " $TOTAL
... (3 Replies)
Discussion started by: greet_sed
3. UNIX for Dummies Questions & Answers
Basically I am trying to calculate the result of "the path" in $3 where the operators follow the number and not preceding them like we normally do:
But I realise (I am sure there is a good reason for that) that awk... (7 Replies)
Discussion started by: beca123456
4. Shell Programming and Scripting
I am writing a script in zsh shell, it fetchs a number from a file using the awk command, store it as a variable, which in my case is a small number 0.62000. I want to change this number by multiplying it by 1000 to become 620.0 using the command in the script
trouble is... (2 Replies)
Discussion started by: piynik
5. Shell Programming and Scripting
I have a file with 3 columns. say,
1 50 68
34 3 23
23 4 56
I want to generate n files from this file using a loop so that 1st column in output file is (column1 of infile/(2*n+2.561))
I am doing like this:
for ((i=1; i<=3; i++))
a=`echo... (3 Replies)
Discussion started by: Surabhi_so_mh
6. Shell Programming and Scripting
I have output like following in a file
19:24:04 (9 Replies)
Discussion started by: fugitive
7. Shell Programming and Scripting
I would appreciate if anyone knows how to perform adding to date.
As for normal date, i can easily plus with any number.
But when it comes to month end say for example 28 Jun, i need to perform a plus with number 3, it will not return 1 Jul.
Thanks in advance for your help. (4 Replies)
Discussion started by: agathaeleanor
8. UNIX for Dummies Questions & Answers
I have a file, its content is as follows:
I want to insert a column, its content is determined by the difference between the two values in the same line, if the difference is less than 20, the new value is 1, otherwise is 0.
after the operation, the... (1 Reply)
Discussion started by: Jenny.palmy
9. Shell Programming and Scripting
I am using egrep to extract numbers from a file and storing them as variables in a script. But I am not able to do any arithmetic operations on the variables using "expr" because it stores them as char and not integers. Here is my code and the error I get. Any help will be appreciated.
#!/bin/sh... (3 Replies)
Discussion started by: emjayshaikh
10. Shell Programming and Scripting
I have no idea why I can't get this to work, if anybody can help i would appreciate it.
x=`cat counter.txt | wc -l`
y= '$x / 7'
printf "%d People have visited this page" $y
:confused: (2 Replies)
Discussion started by: paladyn_2002
pnmscalefixed(1) General Commands Manual pnmscalefixed(1)
pnmscalefixed - scale a portable anymap quickly, but less accurate
pnmscalefixed is the same thing as pnmscale except that it uses fixed point arithmetic internally instead of floating point, which makes it
run faster. In turn, it is less accurate and may distort the image.
Use the pnmscale man page with pnmscalefixed. This man page only describes the difference.
pnmscalefixed uses fixed point 12 bit arithmetic. By contrast, pnmscale uses floating point arithmetic which on most machines is probably
24 bit precision. This makes pnmscalefixed run faster (30% faster in one experiment), but the imprecision can cause distortions at the
right and bottom edges.
The distortion takes the following form: One pixel from the edge of the input is rendered larger in the output than the scaling factor
requires. Consequently, the rest of the image is smaller than the scaling factor requires, because the overall dimensions of the image are
always as requested. This distortion will usually be very hard to see.
pnmscalefixed with the -verbose option tells you how much distortion there is.
The amount of distortion depends on the size of the input image and how close the scaling factor is to an integral 1/4096th.
If the scaling factor is an exact multiple of 1/4096, there is no distortion. So, for example doubling or halving an image causes no dis-
tortion. But reducing it or enlarging it by a third would cause some distortion. To consider an extreme case, scaling a 100,000 row image
down to 50,022 rows would create an output image with all of the input squeezed into the top 50,000 rows, and the last row of the input
copied into the bottom 22 rows of output.
pnmscalefixed could probably be modified to use 16 bit or better arithmetic without losing anything. The modification would consist of a
single constant in the source code. Until there is a demonstrated need for that, though, the Netpbm maintainer wants to keep the safety
cushion afforded by the original 12 bit precision.
pnmscalefixed does not have pnmscale 's -nomix option.
18 November 2000 pnmscalefixed(1)