Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. executableDirectory="$HOME/.foobar2000"
  4. wineCommand="env wine"
  5. executable="foobar2000.exe"
  6.  
  7. command="$wineCommand $executableDirectory/$executable"
  8.  
  9. if [ ! -z "$1" ]; then
  10. ARGUMENTS=()
  11.  
  12. for argument in "$@"
  13. do
  14. if [[ "$argument" == --* ]]; then
  15. argument=${argument/--/"/"}
  16. argument=${argument//-/"\ "}
  17. else
  18. argument=$(readlink -f "$argument")
  19. argument=`echo z:$argument | sed 's/\\//\\\\/g'`
  20. argument="\"$argument\""
  21. fi
  22. ARGUMENTS+=($argument)
  23. done
  24.  
  25. command=$command" ""${ARGUMENTS[*]}"
  26. fi
  27.  
  28. bash -c "cd $executableDirectory"
  29. bash -c "$command &"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement