Advertisement
Guest User

musambascript

a guest
Nov 22nd, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.96 KB | None | 0 0
  1. #!/bin/bash
  2. # creamos la función de menú
  3. menu() {
  4. clear
  5. echo "bienvenido a identifica.sh  pulsa control+c para salir"
  6. echo "dime el nombre del archivo que quieres crear "
  7. read nom
  8. echo "dime que extensión tendrá el archivo "
  9. read ext
  10. sleep 1
  11. echo "ahora crearé el documento $nom con la extensión $ext "
  12. echo "este documento contrendrá tu identificación"
  13. echo "pulsa intro para continuar"
  14. read foo
  15. touch $nom.$ext
  16. echo "SI2A otecruchr Otero Cruz, Christopher `date '+%d-%B-%Y  %T'`" >> $nom.$ext
  17. }
  18. ayuda() {
  19. echo "
  20. "
  21. echo "si quieres identificar un documento escribe su nombre y extensión, por ejemplo 'sh identifica.sh holamundo.txt'.
  22.  
  23. nenú de creación      -m
  24. identificar no identificados    -a
  25. ayuda               -h, --help"
  26. echo "
  27.  
  28. "
  29. }
  30. lista(){
  31. grep -L
  32.  
  33. case $1 in
  34. -m)
  35. menu
  36. ;;
  37. -h)
  38. ayuda
  39. ;;
  40. --help)
  41. ayuda
  42. ;;
  43. -a)
  44. ;;
  45. *)
  46. echo "SI2A otecruchr Otero Cruz, Christopher `date '+%d-%B-%Y  %T'`" >> $1.bak
  47. cat $1 >> $1.bak
  48. rm $1
  49. mv $1.bak $1
  50. ;;
  51. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement