Sponsored Content
Full Discussion: Bash if and loops help
Homework and Emergencies Homework & Coursework Questions Bash if and loops help Post 302513281 by boyboy1212 on Tuesday 12th of April 2011 06:41:12 PM
Old 04-12-2011
Quote:
Originally Posted by Corona688
Code:
REPEAT="y"

while [ "$REPEAT" = "y" ]
do
        echo "stuff"

        echo "Would you like a repeat?(type y/n and hit enter)"
        read REPEAT
done

Wow... I was way off thank you.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

arrays and while loops in bash

hi guys, i have an array called ARRAY which has elements in it... i am trying to assign elements of ARRAY to master_array.. i get a =: command not found error.. i=0 while do ${master_array}=${ARRAY} ((i++)) done is there something i am missing? (4 Replies)
Discussion started by: npatwardhan
4 Replies

2. Shell Programming and Scripting

[bash] IF is eating my loops

Hi! Could someone explain me why the below code is printing the contents of IF block 5 times instead of 0? #!/bin/bash VAR1="something" VAR2="something" for((i=0;i<10;i++)) do if(($VAR1=~$VAR2)) then echo VAR1: $VAR1 echo... (3 Replies)
Discussion started by: machinogodzilla
3 Replies

3. Shell Programming and Scripting

bash scripting: using multiple 'for loops'??

Hey guys, I'm kinda a noob at scripting. I am trying to create a script that uses multiple for loops with the lsiutility to monitor disk health on a system. The script runs, but it will continually echo an infinite number of LogVolumes when there are only 2 per virtual disk on my server. It's... (2 Replies)
Discussion started by: tank126
2 Replies

4. UNIX for Dummies Questions & Answers

A copy paste problem with loops in bash

Hello All, i have a really strange copy paste problem. When I write some loops in an editor for example: for j in 1 2 3 do echo "$j" done and I want to paste it to the shell, the result in the shell is: for j in 1 2 3; do e; other commands work fine and if a copy paste... (4 Replies)
Discussion started by: creamcheese
4 Replies

5. UNIX for Dummies Questions & Answers

Bash loops and variable scope

Hi All, I've been researching this problem and I am pretty sure that the issue is related to the while loop and the piping. There are plenty of other threads about this issue that recommend removing the pipe and using redirection. However, I haven't been able to get it working using the ssh and... (1 Reply)
Discussion started by: 1skydive
1 Replies

6. Shell Programming and Scripting

while loops and variables under bash

Hi, This is probably going to be very simple but i came across something i can't quite explain. Here is the situation: i have a list of files, which i'd like to process one by one (get the size, make some tests, whatever) and generate some statistics using different variables. Something... (5 Replies)
Discussion started by: m69w
5 Replies

7. Shell Programming and Scripting

bash loops

hello i'm writing a script and I want to use a for loop inside a while loop as following: while read line; do echo $line for i in $vrm; do echo $i done done < './contacts' when i use just the while loop it prints the lines from file ./contacts just... (13 Replies)
Discussion started by: vlm
13 Replies

8. Shell Programming and Scripting

Pipe 2 bash loops together

What is the proper way to run two bash loops in the same command? The two below loops run separately, the problem is when I pipe them I get an error that the file used for the second loop does not exist. I am not sure how to wait for the first loop to complete and then start the second. Thank... (10 Replies)
Discussion started by: cmccabe
10 Replies

9. Shell Programming and Scripting

Bash: How to use read with conditions & loops

Hello, Below I try to control that the input is good an IP : #!/bin/bash cp /home/scripts/choice_interfaces.txt /home/scripts/interfaces.txt chmod 644 /home/scripts/interfaces.txt echo -e "Please enter the network informations into the /etc/network/interfaces file, complete them below... (9 Replies)
Discussion started by: Arnaudh78
9 Replies

10. Shell Programming and Scripting

Correlation Between 3 Different Loops using Bash

I have 3 loops that I use to determine the permission level of AWS user accounts. This array lists the AWS policy ARN (Amazon Resource Name): for ((policy_index=0;policy_index<${#aws_managed_policies};++policy_index)); do aws_policy_arn="${aws_managed_policies}" ... (1 Reply)
Discussion started by: bluethundr
1 Replies
SoGLCubeMapImage(3)						       Coin						       SoGLCubeMapImage(3)

NAME
SoGLCubeMapImage - The SoGLCubeMapImage class is used to handle cube map textures. SYNOPSIS
#include <include/Inventor/misc/SoGLCubeMapImage.h> Inherits SoGLImage. Public Types enum Target { NEGATIVE_X = 0, POSITIVE_X, NEGATIVE_Y, POSITIVE_Y, NEGATIVE_Z, POSITIVE_Z } Public Member Functions SoGLCubeMapImage () virtual void unref (SoState *state=NULL) virtual SoType getTypeId (void) const void setCubeMapImage (const Target target, const unsigned char *bytes, const SbVec2s &size, const int numcomponents) virtual void setData (const SbImage *image, const Wrap wraps=REPEAT, const Wrap wrapt=REPEAT, const float quality=0.5f, const int border=0, SoState *createinstate=NULL) virtual void setData (const SbImage *image, const Wrap wraps, const Wrap wrapt, const Wrap wrapr, const float quality=0.5f, const int border=0, SoState *createinstate=NULL) virtual SoGLDisplayList * getGLDisplayList (SoState *state) Static Public Member Functions static SoType getClassTypeId (void) static void initClass (void) Additional Inherited Members Detailed Description The SoGLCubeMapImage class is used to handle cube map textures. Be aware that this class is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API. Since: Coin 3.0 Constructor &; Destructor Documentation SoGLCubeMapImage::SoGLCubeMapImage (void) Constructor. Member Function Documentation void SoGLCubeMapImage::unref (SoState *state = NULL) [virtual] This class has a private destuctor since we want users to supply the current GL state when deleting the image. This is to make sure gl texture objects are freed as soon as possible. If you supply NULL to this method, the gl texture objects won't be deleted until the next time an GLRenderAction is applied in the image's cache context(s). Reimplemented from SoGLImage. SoType SoGLCubeMapImage::getClassTypeId (void) [static] Returns the type id for this class. Reimplemented from SoGLImage. SoType SoGLCubeMapImage::getTypeId (void) const [virtual] Returns the type id for an SoGLImage instance. Reimplemented from SoGLImage. void SoGLCubeMapImage::setData (const SbImage *image, const Wrapwraps = REPEAT, const Wrapwrapt = REPEAT, const floatquality = 0.5f, const intborder = 0, SoState *createinstate = NULL) [virtual] Convenience 2D wrapper function around the 3D setData(). Reimplemented from SoGLImage. void SoGLCubeMapImage::setData (const SbImage *image, const Wrapwraps, const Wrapwrapt, const Wrapwrapr, const floatquality = 0.5f, const intborder = 0, SoState *createinstate = NULL) [virtual] Sets the data for this GL image. Should only be called when one of the parameters have changed, since this will cause the GL texture object to be recreated. Caller is responsible for sending legal Wrap values. CLAMP_TO_EDGE is only supported on OpenGL v1.2 implementations, and as an extension on some earlier SGI implementations (GL_SGIS_texture_edge_clamp). For now, if quality > 0.5 when created, we create mipmaps, otherwise a regular texture is created. Be aware, if you for instance create a texture with texture quality 0.4, and then later try to apply the texture with a texture quality greater than 0.5, the texture object will be recreated as a mipmap texture object. This will happen only once though, of course. If border != 0, the OpenGL texture will be created with this border size. Be aware that this might be extremely slow on most PC hardware. Normally, the OpenGL texture object isn't created until the first time it is needed, but if createinstate is != NULL, the texture object is created immediately. This is useful if you use a temporary buffer to hold the texture data. Be careful when using this feature, since the texture data might be needed at a later stage (for instance to create a texture object for another context). It will not be possible to create texture objects for other cache contexts when createinstate is != NULL. Also if createinstate is supplied, and all the attributes are the same as the current data in the image, glTexSubImage() will be used to insert the image data instead of creating a new texture object. This is much faster on most OpenGL drivers, and is very useful, for instance when doing animated textures. If you supply NULL for image, the instance will be reset, causing all display lists and memory to be freed. Reimplemented from SoGLImage. SoGLDisplayList * SoGLCubeMapImage::getGLDisplayList (SoState *state) [virtual] Returns or creates a SoGLDisplayList to be used for rendering. Returns NULL if no SoDLDisplayList could be created. Reimplemented from SoGLImage. void SoGLCubeMapImage::initClass (void) [static] This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. Reimplemented from SoGLImage. Author Generated automatically by Doxygen for Coin from the source code. Version 3.1.3 Wed May 23 2012 SoGLCubeMapImage(3)
All times are GMT -4. The time now is 11:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy