[Groonga-commit] groonga/gcs [master] Make the script compatible with sed on BSD

Back to archive index

Yoji SHIDARA null+****@clear*****
Tue Aug 28 19:06:10 JST 2012


Yoji SHIDARA	2012-08-28 19:06:10 +0900 (Tue, 28 Aug 2012)

  New Revision: 7383bd2ad76985c6c14523025691879ad132512f
  https://github.com/groonga/gcs/commit/7383bd2ad76985c6c14523025691879ad132512f

  Log:
    Make the script compatible with sed on BSD

  Modified files:
    bin/gcs-import-examples

  Modified: bin/gcs-import-examples (+11 -2)
===================================================================
--- bin/gcs-import-examples    2012-08-28 17:15:58 +0900 (64b79bb)
+++ bin/gcs-import-examples    2012-08-28 19:06:10 +0900 (8ed63ea)
@@ -58,8 +58,17 @@ echo $create_domain_result
 echo
 echo
 
-documents_endpoint=`echo "$create_domain_result" | sed -r -e "s/.+<DocService><Endpoint>//" | sed -r -e "s/<.+//"`
-search_endpoint=`echo "$create_domain_result" | sed -r -e "s/.+<SearchService><Endpoint>//" | sed -r -e "s/<.+//"`
+case $(uname) in
+  Darwin|*BSD)
+    sed="sed -E"
+    ;;
+  *)
+    sed="sed -r"
+    ;;
+esac
+
+documents_endpoint=`echo "$create_domain_result" | $sed -e "s/.+<DocService><Endpoint>//" | $sed -e "s/<.+//"`
+search_endpoint=`echo "$create_domain_result" | $sed -e "s/.+<SearchService><Endpoint>//" | $sed -e "s/<.+//"`
 
 echo "==== Adding index fields"
 echo "== Creating 'name' field"
-------------- next part --------------
HTML����������������������������...
다운로드 



More information about the Groonga-commit mailing list
Back to archive index