Sponsored Content
Top Forums Shell Programming and Scripting How to exit from shell script if above condition fails? Post 302862449 by buzzme on Thursday 10th of October 2013 07:37:17 PM
Old 10-10-2013
do i need to mention any if conditions?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

why shell script fails

hi .. I have automate some process on unix through sehll script . but i don't know there is some problem in scripts, some time shell script works and some time it fails. so my query is that "Why shell script fails some times?" thanks (4 Replies)
Discussion started by: tahir23
4 Replies

2. Shell Programming and Scripting

why shell script fails?

hi , i m trying to run a shell script automatically , some time it works fine but some time it fails , what could be the problem . If anybody have an idea about this problem then reply . Thanks in advacne (4 Replies)
Discussion started by: tahir23
4 Replies

3. Shell Programming and Scripting

How to print error and exit if command fails?

Guys any tips on printing a certain error message to stderr and exiting should a command fail within a ksh script? I'm trying to null some output files. Touch isn't suitable as i need to null them. print "" > file isn't suitable as i need to check elsehere for if they are 0bytes or not. ... (5 Replies)
Discussion started by: lavascript
5 Replies

4. Shell Programming and Scripting

Exit for loop in a shell script if a condition is successfull

Hi All, I am stuch in a script where a for loop is running to execute some commands for some values. Now my problem is i have to have an if condition that if the first iteration is successful then it has to exit the for loop otherwise it has to continue normally. my code is this: for... (5 Replies)
Discussion started by: usha rao
5 Replies

5. Shell Programming and Scripting

Stop execution of script if some condition fails

After my if condtion give rusult true then script should stop execution. Please advice...Thnaks in advance (1 Reply)
Discussion started by: vivek1489
1 Replies

6. UNIX for Dummies Questions & Answers

If condition fails, advise using wildcard

OS Environment: HP-UX B.11.31 U ia64 I am using the shell script code to connect to Oracle RAC database. Passing the parameter of cluster database name. typeset -l DB_ID=$1 + typeset -l DB_ID=sivDB #---- 3. SetDB validation ------------- if ; then print... (3 Replies)
Discussion started by: Siva SQL
3 Replies

7. Shell Programming and Scripting

If condition return 0 even when it fails to satisfy te condition

HI My doubt may be basic one but I need to get it clarified.. When i use "if" condition that checks for many AND, OR logical conditions like if ]; then return 0 fi Even the if condition fails it returns as zero.. Any clue.. But if i add else condition like if ]; ... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies

8. Shell Programming and Scripting

Make expect exit the UNIX script in erreneous condition

Hi, I am writing a menu driven program using shell script. THe script will be collecting data by logging into the other servers and bringing back the data to home server to process it and accordingly issue commands. TO automate commands execution , I am using expect script. However I am not able... (5 Replies)
Discussion started by: ashima jain
5 Replies

9. UNIX for Beginners Questions & Answers

Linux shell | how to exit a script if any command fails.

Hi, i am new here let me say HI for all. now i have a question please: i am sending one command to my machine to create 3 names. if one of the names exists then the box return error message that already have the name but will continue to create the rests. How i can break the command and... (7 Replies)
Discussion started by: Amiri
7 Replies

10. Shell Programming and Scripting

If condition fails for special charecter

I have a sample server name listed in variable as below: var="server-13" I need to check if the 7th character on $var is number 1 whichenv=`echo "$var"| head -c 7 | tail -c 1` if ]; then echo "9 found" else echo "9 Not Found" fi Output: This works... (3 Replies)
Discussion started by: mohtashims
3 Replies
OBJ2RAD(1)						      General Commands Manual							OBJ2RAD(1)

NAME
obj2rad - convert Wavefront .obj file to RADIANCE description SYNOPSIS
obj2rad [ -n ][ -f ][ -m mapfile ][ -o objname ] [ input ] DESCRIPTION
Obj2rad converts a Wavefront .obj file to a RADIANCE scene description. The material names for the surfaces will assigned based on the mapping rules file given in the -m option. If no mapping file is given, the identifiers given by the "usemtl" statements will be used as the material names. If no "usemtl" statements are found, the group names (given by the "g" statement) will be used instead. Failing this, the default material "white" will be used. A mapping file contains a list of materials followed by the conditions a surface must satisfy in order to have that material. For example, if we wanted all faces in the Group "thingy" with texture Map "pine" to use the material "wood", and all other surfaces to use the material "default", we would create the following mapping file: default ; wood (Group "thingy") (Map "pine") ; All faces would satisfy the first set of conditions (which is empty), but only the faces in the Group "thingy" with texture Map "pine" would satisfy the second set of conditions. Each rule can have up to one condition per qualifier, and different translators use different qualifiers. In obj2rad, the valid qualifiers are Material, Map, Group, Object and Face. A condition is either a single value for a specific attribute, or an integer range of values. (Integer ranges are specified in brackets and separated by a colon, eg. [-15:27], and are always inclusive.) A semicolon is used to indi- cate the end of a rule, which can extend over several lines if necessary. The semantics of the rule are such that "and" is the implied conjunction between conditions. Thus, it makes no sense to have more than one condition in a rule for a given qualifier. If the user wants the same material to be used for surfaces that satisfy different conditions, they simply add more rules. For example, if the user also wanted faces between 50 and 175 in the Group "yohey" to use "wood", they would add the following rule to the end of the example above: wood (Face [50:175]) (Group "yohey") ; Note that the order of conditions in a rule is irrelevant. However, the order of rules is very important, since the last rule satisfied determines which material a surface is assigned. By convention, the identifier "void" is used to delete unwanted surfaces. A surface is also deleted if it fails to match any rule. Void is used in a rule as any other material, but it has the effect of excluding all matching surfaces from the translator output. For example, the following mapping would delete all surfaces in the Object "junk" except those with the Group name "beige", to which it would assign the material "beige_cloth", and all other surfaces would be "tacky": tacky ; void (Object "junk") ; beige_cloth (Object "junk") (Group "beige") ; The -n option may be used to produce a list of qualifiers from which to construct a mapping for the given .obj file. This is also useful for determining which materials must be defined when no mapping is used. The -f option is used to flatten all faces, effectively ignoring vertex normal information. This is sometimes desirable when a smaller model or more robust rendering is desired, since interpolating vertex normals takes time and is not always reliable. The -o option may be used to specify the name of this object, though it will be overriden by any "o" statements in the input file. If this option is absent, and there are no "o" statements, obj2rad will attempt to name surfaces based on their group associations. If no input files are given, the standard input is read. DETAILS
The following Wavefront statements are understood and translated by obj2rad. # A comment. This statement is passed to the output verbatim. It has no effect. f A polygonal face. If the vertices have associated surface normals, the face will be broken into quadrilaterals and triangles with the appropriate Radiance textures to interpolate them. Likewise, if the face is non-planar, it will be broken into trian- gles. Each face in the input file is assigned a number, starting with 1, and this number may be used in the material mapping rules. g Group association. The following faces are associated with the named group(s). These may be used in the mapping rules, where a rule is matched if there is an association with the named Group. (I.e. since there may be multiple group associations, any match is considered valid.) If a mapping file is not used and no "usemtl" statement has been encountered, the main group is used for the surface material identifier. o Object name. This is used to name the following faces, and may be used in the mapping rules. usemap A texture map (i.e. Radiance pattern) name. The name may be used in the material mapping rules, but the indexing of Radiance patterns is not yet supported. usemtl A material name. The name may be used in mapping rules, or will be used as the Radiance material identifier if no mapping is given. v A vertex, given by its x, y and z coordinates. vn A vertex normal, given by its x, y and z direction components. This vector will be normalized by obj2rad, and an error will result if it has length zero. vt A vertex texture coordinate. Not currently used, but will be if we ever get around to supporting Wavefront textures. All other statement types will be ignored on the input. A final comment at the end of the Radiance output file will give some indication of how successful the translation was, since it will mention the number of statements obj2rad did not recognize. EXAMPLE
To create a qualifier list for triceratops.obj: obj2rad -n triceratops.obj > triceratops.qual To translate triceratops.obj into a RADIANCE file using the mapping triceratops.map: obj2rad -m triceratops.map triceratops.obj > triceratops.rad NOTES
Many good and useful Wavefront object files are available by anonymous ftp from "avalon.chinalake.navy.mil" in the /pub/objects/obj direc- tory. FILES
tmesh.cal - used for triangle normal interpolation surf.cal - used for quadrilateral normal interpolation AUTHOR
Greg Ward SEE ALSO
arch2rad(1), ies2rad(1), obj2mesh(1), oconv(1), thf2rad(1), xform(1) RADIANCE
6/14/94 OBJ2RAD(1)
All times are GMT -4. The time now is 08:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy