Добавить : через два символа
Добавлено: 2009-03-21 10:32:17
Читал man sed , не нашел ответа
Нужно преобразовать 0019db24f4c0 в 00:19:db:24:f4:c0
Нужно преобразовать 0019db24f4c0 в 00:19:db:24:f4:c0
Иногда, правильный удар в бубен, приводит в чувство целое племя...
https://forum.lissyara.su/
не то читал, нужно либо re_format(7) либо `info regex'RusBiT писал(а):Читал man sed , не нашел ответа
re_format(7) писал(а): A bound is `{' followed by an unsigned decimal integer, possibly followed
by `,' possibly followed by another unsigned decimal integer, always fol-
lowed by `}'. The integers must lie between 0 and RE_DUP_MAX (255#)
inclusive, and if there are two of them, the first may not exceed the
second. An atom followed by a bound containing one integer i and no
comma matches a sequence of exactly i matches of the atom. An atom fol-
lowed by a bound containing one integer i and a comma matches a sequence
of i or more matches of the atom. An atom followed by a bound containing
two integers i and j matches a sequence of i through j (inclusive)
matches of the atom.
RusBiT писал(а):Нужно преобразовать 0019db24f4c0 в 00:19:db:24:f4:c0
Код: Выделить всё
$ echo 0019db24f4c0 | sed 's|.\{2\}|&:|g; s|:$||'Код: Выделить всё
$mac=join ":",$mac =~ /.{2}/g;