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 > 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 and shell scripting languages 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 10:41 AM
Bash while loop problem Kweekwom Shell Programming and Scripting 5 07-23-2007 12:49 AM
Basic signal and alarm usage enuenu High Level Programming 17 05-29-2007 06:50 PM
basic question about disk usage karthikosu AIX 3 07-23-2006 09:16 AM
Why do basic unix commands not work in BASH PixelLover UNIX for Dummies Questions & Answers 10 05-23-2006 03:10 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-18-2007
Orange Stripes Orange Stripes is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 5
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.
  #2 (permalink)  
Old 12-18-2007
porter porter is offline Forum Advisor  
Registered User
  
 

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

Code:
for i in *.zip; do ark $i; done
  #3 (permalink)  
Old 12-18-2007
Orange Stripes Orange Stripes is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 5
Thank you porter! That worked great.
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 04:42 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
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