Posted By

otakurzo on 01/30/11


Tagged

Bash wine sh intype


Versions (?)

intype.sh


 / Published in: Bash
 

Pequeño bash para Intype instalado en Ubuntu con Wine

  1. #!/bin/bash
  2.  
  3. #intype='env WINEPREFIX="/home/otakurzo/.wine" wine C:\\Program\ Files\\Intype\\intype.exe'
  4. intype='env WINEPREFIX="'$HOME'/.wine" wine C:\\Program\ Files\\Intype\\intype.exe'
  5. #params=$*
  6. params=$@
  7. newfile=''
  8. # si recibio 1 parametro
  9. if [ $# -eq 1 ]; then
  10. param=$1
  11. # verifica si intenta abrir la ruta actual con "."
  12. if [ "$param" == '.' ]; then
  13. param="-p \"$(pwd)\""
  14. # si es un directorio
  15. elif [ -d "$param" ]; then
  16. param="-p \"$param\""
  17. #si no es un archivo
  18. elif [ ! -f "$param" ]; then
  19. #echo Error de argumento: \""$1"\" no es un archivo o directorio.
  20. #exit
  21. newfile="$param"
  22. touch "$param"
  23. param=\""$param"\"
  24. fi
  25. params=$param
  26. fi
  27.  
  28. #echo "eval "$intype" "$params""
  29. eval "$intype" "$params"
  30.  
  31. if [ "$newfile" != '' ]; then
  32. filesize=`stat -c %s "$newfile"`
  33. if [ $filesize -eq 0 ]; then
  34. unlink "$newfile"
  35. #rm "$newfile"
  36. fi
  37. fi

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: otakurzo on January 30, 2011

sudo mv intype.sh /bin/intype usage: intype intype . #open project folder intype file.html #open file (If not exists is created).

You need to login to post a comment.