[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [shell-script] Otmização de código
From: |
Fabiano Caixeta Duarte |
Subject: |
Re: [shell-script] Otmização de código |
Date: |
Wed, 7 Jul 2010 14:27:43 -0300 |
Em 7 de julho de 2010 09:06, Daniel Bojczuk <address@hidden> escreveu:
> Ou ainda uma outra forma de usar o cut (falando que o que você quer começa
> no caractere 18 e termina no 19):
>
>
> KERNEL_DIR:=/lib/modules/$(shell uname -r)
>
>
> SUBLEVEL:=$(shell echo $(KERNEL_DIR) | cut -c 18-19)
Melhorando o desempenho e seguindo esta idéia:
SUBLEVEL:=$(shell cut -c 18-19 <<< $(KERNEL_DIR))
Mas o melhor mesmo é, seguindo a sugestão do MrBits, mas sem executar
novamente um uname -r
SUBLEVEL:=$(shell K_DIR=$(KERNEL_DIR); echo ${K_DIR:18:2})
--
Fabiano Caixeta Duarte
Especialista em Redes de Computadores
Linux User #195299
Ribeirão Preto - SP
- Otmização de código, address@hidden, 2010/07/06
- Re: [shell-script] Otmização de código,
Fabiano Caixeta Duarte <=
- Re: [shell-script] Otmização de código, Fernando Luizao, 2010/07/07
- Re: [shell-script] Otmização de código, Cléoson Barreto, 2010/07/07
- Fechar shell, Rogério Tomassoni, 2010/07/07
- Re: [shell-script] Fechar shell, Supergrilo, 2010/07/07
- Re: [shell-script] Fechar shell, Julio C. Neves, 2010/07/08
- Re: [shell-script] Fechar shell, Rogério Tomassoni, 2010/07/08
- Re: [shell-script] Fechar shell, Leandro Quibem Magnabosco, 2010/07/08
- Re: [shell-script] Fechar shell, Rogério Tomassoni, 2010/07/08
- Re: [shell-script] Fechar shell, MrBiTs, 2010/07/08