The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
A basic question of FOR loop er_ashu UNIX for Dummies Questions & Answers 3 09-28-2007 07:41 AM
Bash while loop problem Kweekwom Shell Programming and Scripting 5 07-22-2007 09:49 PM
Basic signal and alarm usage enuenu High Level Programming 17 05-29-2007 03:50 PM
basic question about disk usage karthikosu AIX 3 07-23-2006 06:16 AM
Why do basic unix commands not work in BASH PixelLover UNIX for Dummies Questions & Answers 10 05-23-2006 12:10 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-18-2007
Registered User
 

Join Date: Dec 2007
Posts: 5
Stumble this Post!
Basic bash 'for loop' usage

Hi! I have a simple question about using a for loop.

I'm trying to open up all the zip files in the currect directory with ark, but I am getting the error "bash: syntax error near unexpected token `['".

Code:
for $i [ in `ls *.zip` ] ; do ark $i ; done ;
I looked in the info pages for bash, but I can't seem to figure out what is missing.

Thanks for your time.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-18-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Stumble this Post!
Code:
for i in *.zip
do
     ark $i
done
or

Code:
for i in *.zip; do ark $i; done
Reply With Quote
  #3 (permalink)  
Old 12-18-2007
Registered User
 

Join Date: Dec 2007
Posts: 5
Stumble this Post!
Thank you porter! That worked great.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:36 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0