problems calling out variables in a loop


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting problems calling out variables in a loop
# 8  
Old 07-31-2009
Can you give us what is the value of each and every variable before the for loop starts...
You if-else statement might not be allowing xnum to execute...
Give detailed requirement.

---------- Post updated at 05:36 PM ---------- Previous update was at 05:36 PM ----------

Also try to run the program with
set -x
so that you can debug.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling an interactive perl script from within a while-read loop

Hi, I have a perl script that prompts for a user to enter a password before doing what it does. This works well if I call it directly from a bash script #!/bin/bash /path/to/perl/script $arg1 $arg2 But, when I try to enclose this within a while read loop, the perl script is called but... (1 Reply)
Discussion started by: prafulnama
1 Replies

2. Shell Programming and Scripting

Calling variables in case

Hey guys, I got a little problem with calling variables in my case This is a simple version of my script: var1=1 var2=2 while do case $1 in "a") var1=$var2; echo "1"; echo "var1: $var1"; echo "var2: $var2";; "b") var2=5; echo "2"; (1 Reply)
Discussion started by: Miki1579
1 Replies

3. Web Development

Permission problems calling Ruby from php script

I'm just getting my feet wet with web development, so hopefully this is a simple thing I'm overlooking, but so far I'm stumped. I have a php script that calls Ruby via exec(). This works fine in my test environment, but when I moved it to my production environment I run into a permissions... (7 Replies)
Discussion started by: dantes990
7 Replies

4. UNIX for Dummies Questions & Answers

calling process and going back to the main loop

hi everyone , i want to read an option and depending on the option call the program .For ex #! /bin/ksh export JAVA_HOME=/home/oracle/jdk1.6.0_20 echo " Please enter mod-modeler, dev - sqldeveloper" read choice if ; then echo ' SQL DEVELOPER IS STARTING NOW ... ' cd... (0 Replies)
Discussion started by: kdev
0 Replies

5. Shell Programming and Scripting

Using variables created sequentially in a loop while still inside of the loop [bash]

I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends. As an example I've written a script called question (The fist command is to show what is the contents of the... (2 Replies)
Discussion started by: DeCoTwc
2 Replies

6. Shell Programming and Scripting

for loop, calling and editing multiple files inside

hey guys, I'm trying to call and modify multiple files inside the for loop, i can't get it to work... ------------------------ AFILE=/dir/a_file.txt BFILE=/dir/b_file.txt CFILE=/dir/c_file.txt ADESTFILE=/dir/a_dest_file.txt BDESTFILE=/dir/b_dest_file.txt... (6 Replies)
Discussion started by: DeuceLee
6 Replies

7. Shell Programming and Scripting

Is there a better way I could have run this loop. (For loop with two variables)

Sorry for such a dreadful title, but I'm not sure how to be more descriptive. I'm hoping some of the more gurutastic out there can take a look at a solution I came up with to a problem, and advice if there are better ways to have gone about it. To make a long story short around 20K pieces of... (2 Replies)
Discussion started by: DeCoTwc
2 Replies

8. Shell Programming and Scripting

calling sqlplus from within a for loop

i'm not new to programming, but i AM new to unix scripting. here's my deal. this works: #!/bin/ksh echo "HELLO" /oracle_home/bin/sqlplus username/password@MYDB<<EOF SELECT COUNT(*) FROM EMPLOYEES; EOF exit echo "GOODBYE" this doesn't: #!/bin/ksh echo "HELLO" for x in 1 2... (4 Replies)
Discussion started by: akosz
4 Replies

9. Shell Programming and Scripting

loop of killing and calling process

I make two process killing and calling one process I want to do this repeatedly many time between the interval(sleep) What will be the command to do this, can you make as one do use sleep between and run clear the memory(sh sync.sh) I need your advice, the script will be like this killps... (1 Reply)
Discussion started by: 197oo302
1 Replies

10. Programming

Problems calling external C routines from PL/SQL

Hi everybody! I'm not familiar with C programming in Unix, but I'm trying to make work an example to execute external procedures (developed in C) from PL/SQL. The example includes .c and .pc source files, which I have compiled succesfully. After that, links the .o files into .so to declare... (0 Replies)
Discussion started by: lwnorowski
0 Replies
Login or Register to Ask a Question
_ENV(3) 								 1								   _ENV(3)

$_ENV - Environment variables

	An associative array of variables passed to the current script via the environment method.

	These  variables are imported into PHP's global namespace from the environment under which the PHP parser is running. Many are provided by
       the shell under which PHP is running and different systems are likely running different kinds of shells, a definitive list  is  impossible.
       Please see your shell's documentation for a list of defined environment variables.

	Other environment variables include the CGI variables, placed there regardless of whether PHP is running as a server module or CGI proces-
       sor.

       $HTTP_ENV_VARS contains the same initial information, but is not a superglobal. (Note that $HTTP_ENV_VARS and $_ENV are different variables
       and that PHP handles them as such)

       +--------+---------------------------------------------------+
       |Version |						    |
       |	|						    |
       |	|		     Description		    |
       |	|						    |
       +--------+---------------------------------------------------+
       | 4.1.0	|						    |
       |	|						    |
       |	|  Introduced $_ENV that deprecated $HTTP_ENV_VARS. |
       |	|						    |
       +--------+---------------------------------------------------+
       Example #1

	      $_ENV example

	      <?php
	      echo 'My username is ' .$_ENV["USER"] . '!';
	      ?>

	       Assuming "bjori" executes this script

	      The above example will output something similar to:

	      My username is bjori!

       Note

	      This  is	a  'superglobal', or automatic global, variable. This simply means that it is available in all scopes throughout a script.
	      There is no need to do global $variable; to access it within functions or methods.

       getenv(3), The filter extension.

PHP Documentation Group 														   _ENV(3)