Menu con shellscript

gfxgfx
 
Bienvenido(a), Visitante. Favor de ingresar o registrarse.
¿Perdiste tu email de activación?

Ingresar con nombre de usuario, contraseña y duración de la sesión
 
gfx gfx
gfx
21208 Mensajes en 4872 Temas por 20730 Usuarios - Último usuario: fashionshoesmalls Mayo 22, 2012, 08:19:42
*
gfx*InicioAyudarssBuscarCalendarioIngresarRegistrarsegfx
gfxgfx
0 Usuarios y 1 Visitante están viendo este tema.       « anterior próximo »
Páginas: [1] Ir Abajo Imprimir
Autor Tema: Menu con shellscript  (Leído 1176 veces)
Glifux
Avanzado
**
Desconectado Desconectado

Mensajes: 174

Quiero aprender eso...


Ver Perfil WWW
Menu con shellscript
« en: Octubre 31, 2010, 21:43:30 »

Hola amigos, me surgio una duda (si, otra vez :p) sobre shellscript y no encontre nada en google.

Viendo un archivo del GRUB (el startup manager de ubuntu) me di cuenta de que se trata de un script que se ejecuta al iniciar la compu. Lo que quiero saber es como hacer ese tipo de menu que ofrece GRUB (muestra las opciones y uno elige con las flechas la que desea y presiona enter) en vez del clasico menu 1.Archivar 2.Editar etc

En google solo encontre como hacer menus del segundo tipo, y me interesa saber como se haran los otros.

Desde ya gracias!

Salu2,
Martin
En línea

snf
Administrator
*****
Desconectado Desconectado

Mensajes: 692


Ver Perfil
Re: Menu con shellscript
« Respuesta #1 en: Noviembre 01, 2010, 20:18:44 »

Grub es un boot manager, por lo tanto no usa las mismas librerias que un programa normal, pero si queres ese estilo tendrias que mirar la libreria (n)curses.
En línea

Posts "interesantes"
================
Que es una shellcode?
Bad chars y encoders/decoders en payloads

El tiempo es un gran profesor, pero lamentablemente mata a todos sus alumnos.
Glifux
Avanzado
**
Desconectado Desconectado

Mensajes: 174

Quiero aprender eso...


Ver Perfil WWW
Re: Menu con shellscript
« Respuesta #2 en: Noviembre 03, 2010, 23:30:33 »

No encuentro por ningun lado como usar librerias en shellscript, por ahi soy medio inutil para google o no es como creo :S me podrias dar una mano con esto?

Salu2,
Martin
En línea

snf
Administrator
*****
Desconectado Desconectado

Mensajes: 692


Ver Perfil
Re: Menu con shellscript
« Respuesta #3 en: Noviembre 05, 2010, 21:35:36 »

Para poder usar ncurses en bash tenes que usar la aplicacion dialog, sino la tenes instalala, podes crear todos los controles, ventanas, etc.

seba@laptop-snf:~$ dialog
cdialog (ComeOn Dialog!) version 1.1-20100428
Copyright 2000-2007,2008 Thomas E. Dickey
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

* Display dialog boxes from shell scripts *

Usage: dialog <options> { --and-widget <options> }
where options are "common" options, followed by "box" options

Special options:
  [--create-rc "file"]
Common options:
  [--ascii-lines] [--aspect <ratio>] [--backtitle <backtitle>]
  [--begin <y> <x>] [--cancel-label <str>] [--clear] [--colors]
  [--column-separator <str>] [--cr-wrap] [--date-format <str>]
  [--default-item <str>] [--defaultno] [--exit-label <str>]
  [--extra-button] [--extra-label <str>] [--help-button]
  [--help-label <str>] [--help-status] [--ignore] [--input-fd <fd>]
  [--insecure] [--item-help] [--keep-tite] [--keep-window]
  [--max-input <n>] [--no-cancel] [--no-collapse] [--no-kill]
  [--no-label <str>] [--no-lines] [--no-ok] [--no-shadow] [--nook]
  [--ok-label <str>] [--output-fd <fd>] [--output-separator <str>]
  [--print-maxsize] [--print-size] [--print-version] [--quoted]
  [--scrollbar] [--separate-output] [--separate-widget <str>] [--shadow]
  [--single-quoted] [--size-err] [--sleep <secs>] [--stderr] [--stdout]
  [--tab-correct] [--tab-len <n>] [--time-format <str>] [--timeout <secs>]
  [--title <title>] [--trace <file>] [--trim] [--version] [--visit-items]
  [--yes-label <str>]
Box options:
  --calendar     <text> <height> <width> <day> <month> <year>
  --checklist    <text> <height> <width> <list height> <tag1> <item1> <status1>...
  --dselect      <directory> <height> <width>
  --editbox      <file> <height> <width>
  --form         <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1>...
  --fselect      <filepath> <height> <width>
  --gauge        <text> <height> <width> [<percent>]
  --infobox      <text> <height> <width>
  --inputbox     <text> <height> <width> [<init>]
  --inputmenu    <text> <height> <width> <menu height> <tag1> <item1>...
  --menu         <text> <height> <width> <menu height> <tag1> <item1>...
  --mixedform    <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1> <itype>...
  --mixedgauge   <text> <height> <width> <percent> <tag1> <item1>...
  --msgbox       <text> <height> <width>
  --passwordbox  <text> <height> <width> [<init>]
  --passwordform <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1>...
  --pause        <text> <height> <width> <seconds>
  --progressbox  <height> <width>
  --radiolist    <text> <height> <width> <list height> <tag1> <item1> <status1>...
  --tailbox      <file> <height> <width>
  --tailboxbg    <file> <height> <width>
  --textbox      <file> <height> <width>
  --timebox      <text> <height> <width> <hour> <minute> <second>
  --yesno        <text> <height> <width>

Auto-size with height and width = 0. Maximize with height and width = -1.
Global-auto-size if also menu_height/list_height = 0.
En línea

Posts "interesantes"
================
Que es una shellcode?
Bad chars y encoders/decoders en payloads

El tiempo es un gran profesor, pero lamentablemente mata a todos sus alumnos.
Glifux
Avanzado
**
Desconectado Desconectado

Mensajes: 174

Quiero aprender eso...


Ver Perfil WWW
Re: Menu con shellscript
« Respuesta #4 en: Noviembre 06, 2010, 21:27:00 »

Genial! Muchas gracias de nuevo.. ando hasta las manos mal con la facu hasta el viernes, pero despues me pongo con esto a ver q puedo hacer Smiley

Salu2,
Martin
En línea

gfx
Páginas: [1] Ir Arriba Imprimir 
gfx
Ir a:  
gfx
Powered by SMF 1.1.16 | SMF © 2006, Simple Machines
HDL Group hackers

gfx