[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Shell sh



Jaime Rodríguez Molina wrote:
> Como puedo hacer que en un script con sh una variable cualquiera me almacene
> la salida de un comando?
>
> Por ejemplo necesito en la variable dia la salida del comando date

Si hubieras hecho man bash habrías leído esto:

   Command Substitution
       Command substitution allows the output  of  a  command  to
       replace the command name.  There are two forms:

              $(command)
       or
              `command`

En tu caso:

variable=`date`



Reply to: