• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 316
  • Last Modified:

Linux command line

I am using the following at a Linux command line to search a series of subdirectories and unzip files.  

find incp lotl resi rntl comi -name "*.zip" | while read file ; do unzip -d `dirname $file` $file ; done

This was working fine except that all of a sudden I am getting this error:
while: Expression Syntax.

can anyone suggest what may be going on?

0
pda4me
Asked:
pda4me
  • 3
  • 3
1 Solution
 
Rance_HallCommented:
you sure it doesnt need to be "while read $file"?

0
 
pda4meAuthor Commented:
I tried that and it gives the same error...any ideas?
0
 
ozoCommented:
which shell are you running it under?
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
pda4meAuthor Commented:
csh
0
 
ozoCommented:
Did you try to run it in csh/tcsh instead of sh/bash/ksh
0
 
ozoCommented:
csh uses a different syntax for its while command
the syntax you used is for sh
0
 
pda4meAuthor Commented:
Awesome, that did the trick...thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now