Sponsored Content
Top Forums Shell Programming and Scripting My for loop decides to become an infinite loop? Post 302580491 by gotreef on Thursday 8th of December 2011 05:02:48 PM
Old 12-08-2011
@Corona

This is exactly what I was hoping for. You're telling me that how I think about scripting is garbage and why it's bad. Although telling me how poorly I've written my script, I feel that this better belongs in the noob section.

What I'm trying to do is a bit obtuse so please forgive me if it's poorly explained:
I have a series of satellite images from various locations which are named along the lines of:
Image_date_location
Image_date_location.hdr

These images are of a pixel size (30m) but I'm going to fuzz them out to simulate larger pixel footprints, (250m, 375m, 500m, and 1km); this is accomplished with spatbsq and specifying the parameter $res.

After the 'spatbsq' is done, it should output:
Image_date_location.250m
Image_date_location.250m.hdr
and so on for all I would in theory end up with 4 new files for every original file, one for each resolution.

It's good to know that I shouldn't use backticks in these cases
Could you (or someone else) possibly explain to me what 'done < /tmp/$$' does and why $$ is used instead of a file name?
 

10 More Discussions You Might Find Interesting

1. Solaris

ls command in infinite Loop

Hi, whenever I am giving a 'ls' command system is going into infinite loop displaying the current home directory. There is no separate shell script/file with ls name anywhere in the system. I am using Solaris 10. Any help / guidance in solving this problem is highly appreciated. ... (3 Replies)
Discussion started by: umakant
3 Replies

2. Shell Programming and Scripting

Infinite loop not looping

Hi guys, I'm having a problem getting my infinite loop to loop. It simply reads in the users choice form the menu, executes the corresponding case statement and quits instead of looping back to the main menu again. I have a feeling it might be something with my if then statements within the case... (2 Replies)
Discussion started by: hootdocta5
2 Replies

3. Programming

Is my code in an Infinite Loop?

Production C code compiled without the dash-g option is running, and seems to be in an infinite loop. Is there a way to tell? Is there a diagnostic tool that will report what objects or what lines of code or even what functions are being executed? Or is my best option to kill it with a dump? ... (5 Replies)
Discussion started by: marcus121
5 Replies

4. Shell Programming and Scripting

infinite while do loop problem

hi all, this is how my scrip looks like #!/bin/sh bindir='/opt/apps/script/bin' datadir='/opt/apps/script/data' dir='/opt/apps/script' while : ; do ls -1rt /opt/apps/script/data/check.txt*|tail -1 > /dev/null 2>&1 if ;then chmod +rwx $bindir/dummy2.sh ... (8 Replies)
Discussion started by: tententen
8 Replies

5. Shell Programming and Scripting

Infinite while loop

what is the difference between while:,while true and while false? (6 Replies)
Discussion started by: proactiveaditya
6 Replies

6. UNIX for Advanced & Expert Users

Procmail and infinite loop

I wanted to copy (not forward but copy) all incoming email to another address of mine. It worked, but now I encountered an infinite loop problem: When the second address doesn't like the content and bounces the message back, the bounce message will be sent back and forth. So, what I have in... (1 Reply)
Discussion started by: distill
1 Replies

7. Shell Programming and Scripting

Call a infinite loop

Hi All, I need to run an infinite loop. requirement below: function1 --> creates a file file1 function2 ---> need to call if the file creates i am running these both function via a script --> script.sh i need to run the function1 first and if the file file1 creates then need to run the... (3 Replies)
Discussion started by: satyaranjon
3 Replies

8. Homework & Coursework Questions

Help with infinite loop problem

1. The problem statement, all variables and given/known data: My problem is an infinite loop when i press any other key other then Y or y in the while loop. what i want it to do is return to the normal script outside of it if pressing N or n or keep asking the same question if its any other... (4 Replies)
Discussion started by: Ren_kun
4 Replies

9. Shell Programming and Scripting

How to stop infinite loop

Im unable to stop the below infinite loop (bash script). Can someone tell me why this isnt responding to signals eg: ctrl+c (SIGINT) or ctrl+z c=0 test_loop() { c=$(($c+1)) echo "count value is : $c " sleep 1 test_loop } Im using: SunOS 5.10 PS: If run this as... (13 Replies)
Discussion started by: Arun_Linux
13 Replies

10. Shell Programming and Scripting

Infinite loop query

I have a script script.shwhich is scheduled to run at 11 AM everyday. # script.sh Code: ./scb_script.sh & unfortunately scb_script.sh is running today in infinite loop as respective files are not available. My question, when script.sh starts running tomorrow, will the old process be... (1 Reply)
Discussion started by: JSKOBS
1 Replies
PDFBLUR(1)						      General Commands Manual							PDFBLUR(1)

NAME
pdfblur - generate views for depth-of-field blurring SYNOPSIS
pdfblur aperture nsamp viewfile DESCRIPTION
Pdfblur takes the given viewfile and computes nsamp views based on an aperture diameter of aperture (in world coordinate units) and a focal distance equal to the length of the -vd view direction vector. When rendered and averaged together, these views will result in a picture with the specified depth of field. Either pinterp(1) or rpict(1) may be called to do the actual work. (The given viewfile must also be passed on the command line to the chosen renderer, since pdfblur provides supplemental view specifications only.) For pinterp, feed the output of pdfblur to the standard input of pinterp and apply the -B option to blur views together. In most cases, a single picture with z-buffer is all that is required to get a satisfactory result, though the perfectionist may wish to apply three pic- tures arranged in a triangle about the aperature, or alternatively apply the -ff option together with the -fr option of pinterp. (The lat- ter may actually work out to be faster, since rendering three views takes three times as long as a single view, and the -fr option will end up recomputing relatively few pixels by comparison.) To use pdfblur with rpict, apply the -S option to indicate a rendering sequence, and set the -o option with a formatted file name to save multiple output pictures. When all the renderings are finished, combine them with the pcomb(1) program, using appropriate scalefactors to achieve an average. Note that using rpict is MUCH more expensive than using pinterp, and it is only recommended if the scene and applica- tion absolutely demand it (e.g. there is prominent refraction that must be modeled accurately). For both pinterp and rpict, the computation time will be proportional to the number of views from pdfblur. We have found a nsamp setting somewhere between 5 and 10 to be adequate for most images. Relatively larger values are appropriate for larger aperatures. The -pd option of rpict may be used instead or in combination with or instead of pdfblur to blur depth-of-field. If used in combination, it is best to set the -pd option to the overall aperture divided by nsamp to minimize ghosting in the output. To simulate a particular camera's aperture, divide the focal length of the lens by the f-number, then convert to the corresponding world coordinate units. For example, if you wish to simulate a 50mm lens at f/2.0 in a scene modeled in meters, then you divide 50mm by 2.0 to get 25mm, which corresponds to an effective aperture of 0.025 meters. EXAMPLES
To use pinterp to simulate an aperture of 0.5 inches on a lens focused at a distance of 57 inches: rpict -vf myview -x 640 -y 480 -z orig.zbf scene.oct > orig.hdr pdfblur 0.5 57 8 orig.hdr | pinterp -B -vf orig.hdr -x 640 -y 480 orig.hdr orig.zbf > blurry.hdr To use rpict exclusively to do the same: pdfblur .5 57 5 myview | rpict -S 1 -vf myview -x 640 -y 480 -o view%d.hdr scene.oct pcomb -s .2 view1.hdr -s .2 view2.hdr -s .2 view3.hdr -s .2 view4.hdr -s .2 view5.hdr > blurry.hdr AUTHOR
Greg Ward BUGS
This program really only works with perspective views. SEE ALSO
pcomb(1), pinterp(1), pmblur(1), pmdblur(1), rcalc(1), rpict(1), vwright(1) RADIANCE
1/24/96 PDFBLUR(1)
All times are GMT -4. The time now is 11:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy