homepage Welcome to WebmasterWorld Guest from 54.227.41.242
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
bash assignment
thegrinder




msg:4071184
 9:09 pm on Jan 30, 2010 (gmt 0)

Hi , i've been programming in bash for a week or so and have this assignment to do but i get this error message when i execute my program:

line 6: syntax error near unexpected token `do

And here's my code:

#!/bin/sh
while [ -n $1 ]
do
list= `ls $1`
for i in $list
do
cat $i >> basename $i
rm $i
done
shift 1
done

I know it's a stupid mistake but i can't figure it out.

Thanks

 

phranque




msg:4071880
 1:28 pm on Feb 1, 2010 (gmt 0)

i would add some echo statements to verify that the argument you are passing is as expected and that the list variable for example contains what you expected.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved