![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Passing global variable to a function which is called by another function | sars | Shell Programming and Scripting | 4 | 06-30-2008 08:39 AM |
| Help with the 2 for loops | vadharah | Shell Programming and Scripting | 1 | 03-04-2008 12:26 PM |
| two loops | big123456 | UNIX for Dummies Questions & Answers | 2 | 10-11-2005 12:08 AM |
| Loops | mariner | UNIX for Advanced & Expert Users | 2 | 07-01-2004 04:50 AM |
| no more loops | tony3101 | Shell Programming and Scripting | 5 | 06-09-2004 11:01 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
loops within a function
I have a function where i am imputting data to the function. Within the function is a while loop reading the data put into the function. I want to put a FOR loop within the while loop but it keeps stopping the while loop on the first run. Could anyone help please.
|
| Forum Sponsor | ||
|
|
|
|||
|
Operatoring system AIX 5.1
example code, function error_routine { while read user_id day_no month time error_file do USER=`grep ${user_id} $passwordfile | sed 's/:/ /g' | awk '{ print $5,$6 } '` echo "$USER created error file $error_file in $testdir on $d ay_no $month at $time" for RECIPIENT in ${MAIL_ADDRESS} do MAIL_SUBJECT="$USER has generated an error fil e: $error_file in $testdir on $day_no $month at $time" pine -I^X,y -subject "${MAIL_SUBJECT}" ${RECIPIENT} EXIT_CODE=$? if [ ${EXIT_CODE} -ne 0 ] then EXIT_CODE=1 echo "There was a problem emailing the error file: $erro f_file in $testdir generated by $USER on $day_no $month at $time to ${RECIPIENT}" fi done done } error_routine<$OUTPUT |
|||
| Google UNIX.COM |