Sponsored Content
Top Forums Shell Programming and Scripting Bash function failing with [: too many arguments Post 303004867 by jakeroberts on Tuesday 10th of October 2017 09:13:37 AM
Old 10-10-2017
Quote:
Originally Posted by Scott
The first thing I would usually do here is echo the variables before the test (before the if), and do some sanitation on them. I would also declare each variable on its own line, and quote them when using them.
Thanks for the quick replies. I'm at work now, but I will try this when I get home. Thanks again.
 

10 More Discussions You Might Find Interesting

1. Programming

sscanf function is failing

Please delete this thread. (0 Replies)
Discussion started by: jxh461
0 Replies

2. Shell Programming and Scripting

no of arguments to function in shell script

Hi, I have a function in shell script fun1{ echo "No.of arguments are..."} this function will be called in same script by passing arguments fun 1 2 3 I want to check the no. of arguments passed to fun1 function in the same functionbefore validation. can any one suggest me. (2 Replies)
Discussion started by: KiranKumarKarre
2 Replies

3. Programming

Error: too many arguments to function 'sigwait'

#include <pthread.h> #include <signal.h> ... sigset_t mask; int err,signo; err=sigwait(&mask,&signo); switch(signo){ case SIGINT: ... } when I compile above code under solaris 10,it raise following error: error: too many arguments to function 'sigwait' I look up signal... (4 Replies)
Discussion started by: konvalo
4 Replies

4. Shell Programming and Scripting

cat arguments to a function

Hi, I've a logging function in bourne shell, flog() which logs the first argument passed to it. How can I pass arguments to this function from a file, like cat filename | sed '...filtering...' | flog or cat filename | sed '...filtering...' | xargs flog Which did not work, after which... (3 Replies)
Discussion started by: Random_Net
3 Replies

5. UNIX for Advanced & Expert Users

Function not called when no arguments is passed

Hi Guys, I am trying to pass arguments to the script i am wrinting. When no argument is passed or wrong argument is passed, the script needs to output the way it needs to be called and exit. Currently, when no arguments is passed, it is not getting exited but goes on assuming those... (3 Replies)
Discussion started by: mac4rfree
3 Replies

6. Shell Programming and Scripting

bash read within function with arguments

I have trouble getting this logic to work #!/bin/bash function assign_var(){ while do read -p "$2 :" $3 done } assign_var '$IPADDRESS' ipaddress IPADDRESS Basicly, i want to make sure that entry is made (i can add more sophisticated checks later), but the idea is to recycle... (11 Replies)
Discussion started by: serverchief
11 Replies

7. Shell Programming and Scripting

Need to call a function with arguments

I need to call a function within a code with $database and $ service as the arguments How do I proceed ? and how would a function be defined and these two arguments would be used inside the function? calc_pref_avail $database $service Best regards, Vishal (7 Replies)
Discussion started by: Vishal_dba
7 Replies

8. UNIX for Dummies Questions & Answers

Invoke Function WithOut Non-Positional Arguments

Hello Everyone, Is there a way i can pass the arguments as parameters or variables instead of positional arguments to a function, below i am calling the function defined in a script. Call: notify "Error While Generating The List File: ${GEN_PARAM_LIST9} For Feed Data Validation Errors In... (1 Reply)
Discussion started by: Ariean
1 Replies

9. Shell Programming and Scripting

Bash Regexp failing: unexpected token `('

Hey guys, I'm fairly new to bash scripting, so bear with me :) What I want to achieve is reading a file (.php), find the phrase 'WACHTWOORD' (password) in it, and collect the password and a part of the filename in a list. The filename is always 'settings_{name}.php' and the part I'm looking... (6 Replies)
Discussion started by: Eggie01
6 Replies

10. Shell Programming and Scripting

Call same function using 2 different arguments

I have a script that uses 2 arguments. I want to call the function part within this script using these same arguments. Below is what I came up with below script so far, any guidance would be helpful. Thank you! cat backup.sh #!/bin/bash function usage { echo "USAGE: $(basename $0)... (6 Replies)
Discussion started by: mbak
6 Replies
GLFRUSTUM(3G)							   OpenGL Manual						     GLFRUSTUM(3G)

NAME
glFrustum - multiply the current matrix by a perspective matrix C SPECIFICATION
void glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearVal, GLdouble farVal); PARAMETERS
left, right Specify the coordinates for the left and right vertical clipping planes. bottom, top Specify the coordinates for the bottom and top horizontal clipping planes. nearVal, farVal Specify the distances to the near and far depth clipping planes. Both distances must be positive. DESCRIPTION
glFrustum describes a perspective matrix that produces a perspective projection. The current matrix (see glMatrixMode()) is multiplied by this matrix and the result replaces the current matrix, as if glMultMatrix() were called with the following matrix as its argument: 2 nearVal right - left 0 A 0 0 2 nearVal top - bottom B 0 0 0 C D 0 0 -1 0 A = right + left right - left B = top + bottom top - bottom C = - farVal + nearVal farVal - nearVal D = - 2 farVal nearVal farVal - nearVal Typically, the matrix mode is GL_PROJECTION, and left bottom - nearVal and right top - nearVal specify the points on the near clipping plane that are mapped to the lower left and upper right corners of the window, assuming that the eye is located at (0, 0, 0). - farVal specifies the location of the far clipping plane. Both nearVal and farVal must be positive. Use glPushMatrix() and glPopMatrix() to save and restore the current matrix stack. NOTES
Depth buffer precision is affected by the values specified for nearVal and farVal. The greater the ratio of farVal to nearVal is, the less effective the depth buffer will be at distinguishing between surfaces that are near each other. If r = farVal nearVal roughly log 2 r bits of depth buffer precision are lost. Because r approaches infinity as nearVal approaches 0, nearVal must never be set to 0. ERRORS
GL_INVALID_VALUE is generated if nearVal or farVal is not positive, or if left = right, or bottom = top, or near = far. GL_INVALID_OPERATION is generated if glFrustum is executed between the execution of glBegin() and the corresponding execution of glEnd(). ASSOCIATED GETS
glGet() with argument GL_MATRIX_MODE glGet() with argument GL_MODELVIEW_MATRIX glGet() with argument GL_PROJECTION_MATRIX glGet() with argument GL_TEXTURE_MATRIX glGet() with argument GL_COLOR_MATRIX SEE ALSO
glOrtho(), glMatrixMode(), glMultMatrix(), glPushMatrix(), glViewport() COPYRIGHT
Copyright (C) 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/. AUTHORS
opengl.org opengl.org 06/10/2014 GLFRUSTUM(3G)
All times are GMT -4. The time now is 08:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy