The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
syntax error in while loop habzone2007 Shell Programming and Scripting 1 05-18-2008 04:31 PM
Error connecting oracle from inside while loop Devesh5683 Shell Programming and Scripting 3 05-13-2008 02:48 AM
For loop statement - catch error lumdev Shell Programming and Scripting 4 09-20-2007 07:50 AM
error in bash script 'if' loop DILEEP410 Shell Programming and Scripting 2 06-06-2007 08:04 AM
Unix-Sql Loop error manu_byc Shell Programming and Scripting 3 02-05-2007 09:40 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-27-2005
hugow hugow is offline
Registered User
  
 

Join Date: Jun 2005
Posts: 15
Error in for loop?

Hi,

Working on AIX using the following for loop.

for a in `find /edi/iTracTEST/sessions -name nohup.out -print`
do
echo $a
done

On the command line it works fine, but insert the code in a file and then running it, it does not want to work. I get the following back.


' is not expected.s2.sh: 0403-057 Syntax error at line 3 : `do

Please advice
  #2 (permalink)  
Old 06-27-2005
bhargav's Avatar
bhargav bhargav is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2004
Location: USA
Posts: 511
There is no problem i have seen in this script.
Working for me on AIX 4.3

Do you have any other lines in the script ? or just these lines ?
  #3 (permalink)  
Old 06-28-2005
hugow hugow is offline
Registered User
  
 

Join Date: Jun 2005
Posts: 15
No this is all there is at the moment. Have reduced the script to 4 lines due to this problem so that I can isolate it.
Is the syntax correct for using in a script?
  #4 (permalink)  
Old 06-28-2005
hugow hugow is offline
Registered User
  
 

Join Date: Jun 2005
Posts: 15
This is a Korn Shell script. Any ideas to what is causing the error.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 07:54 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0