Re: pipe como variable en bash

2018-02-04 Por tema petrohs el compa obrero
a mi se me ocurre

export variable="$(rtl_fm -f 43350 -s 20 -r 96000 -g 19.7
2>/dev/null | Efergy)";

y ya podrias usar la variable dentro de MiScript.sh

On Sun, Feb 4, 2018 at 3:34 PM, fernando sainz  wrote:

> El día 4 de febrero de 2018, 21:32, Josu Lazkano
>  escribió:
> > Buenas,
> >
> > Tengo un pequeño problema de scripting que no se como resolver.
> > Dispongo de un comando que me da el consumo eléctrico de mi casa:
> >
> > # rtl_fm -f 43350 -s 20 -r 96000 -g 19.7 2>/dev/null | Efergy
> >
> > Lo que quiero es redirigir esta salida a un script en bash y tratar la
> > salida como una variable. Algo así:
> >
> > # rtl_fm -f 43350 -s 20 -r 96000 -g 19.7 2>/dev/null | Efergy
> > | MiScript.sh
> >
> > El problema es que no se como capturar la variable, he probado con
> > "$1" pero solo sirve para argumentos.
> >
> > ¿Alguien me pude ayudar?
> >
> > Gracias por todo y un saludo.
> >
> > --
> > Josu Lazkano
> >
>
> No entiendo muy bien lo que preguntas.
> Creo que podrías poner en tu script llamadas a "read" (man bash) que
> lee una linea de la entrada estándar.
>
>
>read [-ers] [-a aname] [-d delim] [-i text] [-n nchars] [-N nchars]
> [-p
>prompt] [-t timeout] [-u fd] [name ...]
>   One line is read from the  standard  input,  or  from  the
> file
>   descriptor  fd supplied as an argument to the -u option, and
> the
>   first word is assigned to the first name, the second word to
> the
>   second  name, and so on, with leftover words and their
> interven‐
>   ing separators assigned to the last name.  If  there  are
> fewer
>   words read from the input stream than names, the remaining
> names
>   are assigned empty values.  The characters in IFS  are
> used  to
>   split  the  line  into words using the same rules the shell
> uses
>   for expansion (described above under Word Splitting).  The
> back‐
>   slash  character  (\)  may be used to remove any special
> meaning
>   for the next character read and for line continuation.
> Options,
>   if supplied, have the following meanings:
>
> S2.
>
>


-- 
"Cada cual según sus fuerzas, cada quien según sus necesidades..."


Re: pipe como variable en bash

2018-02-04 Por tema fernando sainz
El día 4 de febrero de 2018, 21:32, Josu Lazkano
 escribió:
> Buenas,
>
> Tengo un pequeño problema de scripting que no se como resolver.
> Dispongo de un comando que me da el consumo eléctrico de mi casa:
>
> # rtl_fm -f 43350 -s 20 -r 96000 -g 19.7 2>/dev/null | Efergy
>
> Lo que quiero es redirigir esta salida a un script en bash y tratar la
> salida como una variable. Algo así:
>
> # rtl_fm -f 43350 -s 20 -r 96000 -g 19.7 2>/dev/null | Efergy
> | MiScript.sh
>
> El problema es que no se como capturar la variable, he probado con
> "$1" pero solo sirve para argumentos.
>
> ¿Alguien me pude ayudar?
>
> Gracias por todo y un saludo.
>
> --
> Josu Lazkano
>

No entiendo muy bien lo que preguntas.
Creo que podrías poner en tu script llamadas a "read" (man bash) que
lee una linea de la entrada estándar.


   read [-ers] [-a aname] [-d delim] [-i text] [-n nchars] [-N nchars] [-p
   prompt] [-t timeout] [-u fd] [name ...]
  One line is read from the  standard  input,  or  from  the  file
  descriptor  fd supplied as an argument to the -u option, and the
  first word is assigned to the first name, the second word to the
  second  name, and so on, with leftover words and their interven‐
  ing separators assigned to the last name.  If  there  are  fewer
  words read from the input stream than names, the remaining names
  are assigned empty values.  The characters in IFS  are  used  to
  split  the  line  into words using the same rules the shell uses
  for expansion (described above under Word Splitting).  The back‐
  slash  character  (\)  may be used to remove any special meaning
  for the next character read and for line continuation.  Options,
  if supplied, have the following meanings:

S2.



pipe como variable en bash

2018-02-04 Por tema Josu Lazkano
Buenas,

Tengo un pequeño problema de scripting que no se como resolver.
Dispongo de un comando que me da el consumo eléctrico de mi casa:

# rtl_fm -f 43350 -s 20 -r 96000 -g 19.7 2>/dev/null | Efergy

Lo que quiero es redirigir esta salida a un script en bash y tratar la
salida como una variable. Algo así:

# rtl_fm -f 43350 -s 20 -r 96000 -g 19.7 2>/dev/null | Efergy
| MiScript.sh

El problema es que no se como capturar la variable, he probado con
"$1" pero solo sirve para argumentos.

¿Alguien me pude ayudar?

Gracias por todo y un saludo.

-- 
Josu Lazkano



Re: grsecurity den debian 8

2018-02-04 Por tema Felix Perez
El 4 de febrero de 2018, 12:16, Felix Perez
 escribió:
> El 4 de febrero de 2018, 06:15, R Calleja  escribió:
>> Buenos dias ,
>> alguien ha instalado los parches de grsecurity en debian 8 y puede ayudarme.
>> Instale el kernel con grsecurity desde el repositorio backports, pero no se
>> ejecutan libreoffice-cal ni el navegador firefox.
>> Sabe alguien como se administra grsecutiry.
>>
>
> Supongo ya hiciste esto:
> https://www.google.cl/search?source=hp=iCN3WufQOoeBwgT2t5PoDQ=+grsecurity+=+grsecurity+_l=psy-ab.3..0i19k1l10.3310.3310.0.4082.3.2.0.0.0.0.286.286.2-1.2.00...1c..64.psy-ab..1.1.285.0...201.LbfNM-J_MLs
>

Y después esto:
https://en.wikibooks.org/wiki/Grsecurity#Administration


>
>
>
> --
> usuario linux  #274354
> normas de la lista:  http://wiki.debian.org/es/NormasLista
> como hacer preguntas inteligentes:
> http://www.sindominio.net/ayuda/preguntas-inteligentes.html



-- 
usuario linux  #274354
normas de la lista:  http://wiki.debian.org/es/NormasLista
como hacer preguntas inteligentes:
http://www.sindominio.net/ayuda/preguntas-inteligentes.html



Re: grsecurity den debian 8

2018-02-04 Por tema Felix Perez
El 4 de febrero de 2018, 06:15, R Calleja  escribió:
> Buenos dias ,
> alguien ha instalado los parches de grsecurity en debian 8 y puede ayudarme.
> Instale el kernel con grsecurity desde el repositorio backports, pero no se
> ejecutan libreoffice-cal ni el navegador firefox.
> Sabe alguien como se administra grsecutiry.
>

Supongo ya hiciste esto:
https://www.google.cl/search?source=hp=iCN3WufQOoeBwgT2t5PoDQ=+grsecurity+=+grsecurity+_l=psy-ab.3..0i19k1l10.3310.3310.0.4082.3.2.0.0.0.0.286.286.2-1.2.00...1c..64.psy-ab..1.1.285.0...201.LbfNM-J_MLs




-- 
usuario linux  #274354
normas de la lista:  http://wiki.debian.org/es/NormasLista
como hacer preguntas inteligentes:
http://www.sindominio.net/ayuda/preguntas-inteligentes.html



grsecurity den debian 8

2018-02-04 Por tema R Calleja
Buenos dias ,
alguien ha instalado los parches de grsecurity en debian 8 y puede ayudarme.
Instale el kernel con grsecurity desde el repositorio backports, pero no se
ejecutan libreoffice-cal ni el navegador firefox.
Sabe alguien como se administra grsecutiry.

Muchas gracias, Roberto.