Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am quite new to Linux and currently I am using Cygwin on my Windows machine. My problem is I made a script to automate my analytics work and used process substitution in it and it worked fine when running on Cygwin. But when running that same script on a Linux machine it is showing problems with process substitution. So I'm bit confused. Snippet of my script is:

echo "enter url"
read val
echo "enter file name "
read file
let cnt=0
while read -r line
do
    arr[$cnt]="$line"
    x=${arr[cnt]}
    cnt=$(( $cnt + 1 ))
    cd /cygdrive/c/nutch
    bin/nutch readseg -get crawl/segments/$x $val -nogenerate -noparse \
      -nocontent -noparsetext >>out.txt
 done < <(ls -1 /cygdrive/c/nutch/crawl/segments)
share|improve this question
    
We can't help. Unless you post enough details. –  manatwork Jul 5 '13 at 11:24
    
Problem is when running script on linux machine it is showing problem with line- done < <(cat pattern.txt) / –  user2060673 Jul 5 '13 at 11:32
1  
I trust of course that on Linux you change the path? (Unless you actually have a /cygdrive/c/… on your Linux box?). Also, what's wrong with for line in /cygdrive/c/nutch/crawl/segments/*; do ? –  derobert Jul 8 '13 at 8:33
1  
Without information about which shells are being used, this question is not answerable. –  Chris Down Jul 8 '13 at 11:18
1  
You may be able to replace done < <(cat pattern.txt) with done < pattern.txt. –  paraxor Jul 8 '13 at 15:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.