Index: src/bin/crawl
===================================================================
--- src/bin/crawl	(revision 1420936)
+++ src/bin/crawl	(working copy)
@@ -122,7 +122,7 @@
   # or use ls
 
   if [ $mode = "local" ]; then
-   SEGMENT=`ls -l $CRAWL_PATH/segments/ | sed -e "s/ /\\n/g" | egrep 20[0-9]+ | sort -n | tail -n 1`
+   SEGMENT=`ls -l $CRAWL_PATH/segments/ | awk '{ print $9 }' | egrep 20[0-9]+ | sort -n | tail -n 1`
   else
    SEGMENT=`hadoop fs -ls $CRAWL_PATH/segments/ | grep segments |  sed -e "s/\//\\n/g" | egrep 20[0-9]+ | sort -n | tail -n 1`
   fi
@@ -166,7 +166,7 @@
   fi
 
   echo "Indexing $SEGMENT on SOLR index -> $SOLRURL"
-  $bin/nutch solrindex $SOLRURL $CRAWL_PATH/crawldb -linkdb $CRAWL_PATH/linkdb $SEGMENT
+  $bin/nutch solrindex $SOLRURL $CRAWL_PATH/crawldb -linkdb $CRAWL_PATH/linkdb $CRAWL_PATH/segments/$SEGMENT
   
   if [ $? -ne 0 ] 
    then exit $? 
