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:
- Follow-Ups:
- Re: Shell sh
- From: Jaime Rodríguez Molina <jr.molina@wanadoo.es>
- Re: Shell sh
- From: Antonio Castro <acastro@ciberdroide.com>
- References:
- Shell sh
- From: Jaime Rodríguez Molina <jr.molina@wanadoo.es>