Guest User

Untitled

a guest
Apr 26th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #-------- BLACKRAY CONFIG ---------------#
  4. # Make sure the current user is in the sudoers list
  5. # Running all instances with sudo
  6.  
  7. BLACKRAY_BIN_PATH='/opt/blackray/bin'
  8. BLACKRAY_LOADER_DEF_PATH='/home/crozzfire'
  9. BLACKRAY_LOADER_DEF_NAME='load.xml'
  10. BLACKRAY_CSV_PATH='/home/crozzfire'
  11. BLACKRAY_END_POINT='default -p 8890'
  12. OUT_FILE='/tmp/out.log'
  13.  
  14. echo "The current binary path is $BLACKRAY_BIN_PATH"
  15.  
  16.  
  17. # Starting the blackray 0.9.0 server
  18. sudo "$BLACKRAY_BIN_PATH/blackray_start"
  19.  
  20. # Starting the blackray loader utility
  21. BLACKRAY_INDEX_CMD="$BLACKRAY_BIN_PATH/blackray_loader -c $BLACKRAY_LOADER_DEF_PATH/$BLACKRAY_LOADER_DEF_NAME -d $BLACKRAY_CSV_PATH -e ""$BLACKRAY_END_POINT"""
  22.  
  23. sudo time $BLACKRAY_INDEX_CMD -a $OUT_FILE
  24.  
  25. #--------- END BLACKRAY CONFIG ---------#
  26.  
  27. BLACKRAY_END_POINT="'default -p 8890'"
  28.  
  29. BLACKRAY_END_POINT='"default -p 8890"'
  30.  
  31. BLACKRAY_END_POINT="default -p 8890"
  32.  
  33. BLACKRAY_END_POINT='default -p 8890'
  34.  
  35. BLACKRAY_INDEX_CMD="$BLACKRAY_BIN_PATH/blackray_loader -c $BLACKRAY_LOADER_DEF_PATH/$BLACKRAY_LOADER_DEF_NAME -d $BLACKRAY_CSV_PATH -e $BLACKRAY_END_POINT"
  36.  
  37. 1 two words
  38. 2 two words
  39. 3 two
  40. 4 words
  41.  
  42. #!/bin/bash
  43. echo "No quotes in script"
  44. echo $1
  45. grep $1 test.txt
  46. echo
  47.  
  48. echo "With quotes in script"
  49. echo "$1"
  50. grep "$1" test.txt
  51. echo
  52.  
  53. No quotes in script
  54. two words
  55. grep: words: No such file or directory
  56. test.txt:1 two words
  57. test.txt:2 two words
  58. test.txt:3 two
  59.  
  60. With quotes in script
  61. two words
  62. 2 two words
  63.  
  64. sudo time $BLACKRAY_BIN_PATH/blackray_loader -c $BLACKRAY_LOADER_DEF_PATH/$BLACKRAY_LOADER_DEF_NAME -d $BLACKRAY_CSV_PATH -e "$BLACKRAY_END_POINT" -a $OUT_FILE
  65.  
  66. BLACKRAY_INDEX_CMD=($BLACKRAY_BIN_PATH/blackray_loader -c $BLACKRAY_LOADER_DEF_PATH/$BLACKRAY_LOADER_DEF_NAME -d $BLACKRAY_CSV_PATH -e "$BLACKRAY_END_POINT")
  67.  
  68. sudo time "${BLACKRAY_INDEX_CMD[@]}" -a $OUT_FILE
Add Comment
Please, Sign In to add comment