![]() |
Olá e boas-vindas de Estados Unidos para o UNIX e Linux Forum! Obrigado por visitar e fazer parte da nossa comunidade global.
|
|
google unix.com
|
|||||||
| Fóruns | Registar | Fórum Regimento | Ligações | Álbuns | FAQ | Lista deputados | Calendário | Pesquisa | Today's Posts | Mark Forums Read |
| Programação Shell Script e Post perguntas sobre ksh, CSH, SH, BASH, Perl, PHP, SED, Awk e outros scripts shell e shell scripts línguas aqui. |
Mais UNIX e Linux Fórum Tópicos Você pode achar Helpfull
|
||||
| Fio | Thread Starter | Fórum | Respostas | Última postagem |
| awk Shell Script erro: "Erro de sintaxe:` Split 'inesperado | Herry | UNIX para Dummies Perguntas & Respostas | 2 | 03-17-2008 11:16 |
| erro durante a correr: St9bad_alloc - Como esse erro ao utilizar algumas conversão progr | sathu_pec | Programação Shell Script e | 1 | 01-21-2008 02:38 |
| Eu tenho ... como erro de erro de sintaxe na linha 1, teleimpressor | koti_rama | UNIX & avançada para usuários experientes | 2 | 07-07-2007 08:35 |
| erro na leitura secções erro instalar | doelman | Sun Solaris | 2 | 02-05-2007 12:21 |
| Erro: Erro interno do sistema: Não foi possível inicializar o arquivo de saída padrão | firkus | UNIX para Dummies Perguntas & Respostas | 2 | 10-25-2005 04:23 |
|
|
Linkback | Thread Tools | Pesquisar este Thread | Rate Thread | Display Modes |
|
||||
|
Erro ao usar sed
Oi,
Eu tenho um arquivo de entrada com o seguinte conteúdo -------------------------------------------------- ------- Executar Número: 1 --------------------------------------- -------------------- test_run-layout test_vaal-i [/ x/TEST/batch/temp/20070528_ip.txt / x/TEST/batch/temp/20070528__op.txt] | Começar | 05/28/2007 02:19:30 | TESTE | 8651 -------------------------------------------------- ------- out_file ------------------------------------------ ----------------- item_id | status_desc | descrição test_run-layout test_vaal-i [/ x/TEST/batch/temp/20070528_ip.txt / x/TEST/batch/temp/20070528__op.txt] | Encerrado | 05/28/2007 02:19:33 | TESTE | 8651 -------------------------------------------------- ------- Executar Número: 2 --------------------------------------- -------------------- test_run-layout test_vaal-i [/ x/TEST/batch/temp/20070528_ip.txt / x/TEST/batch/temp/20070528__op.txt] | Começar | 05/28/2007 02:27:25 | TESTE | 24745 -------------------------------------------------- ------- out_file ------------------------------------------ ----------------- item_id | status_desc | descrição test_run-layout test_vaal-i [/ x/TEST/batch/temp/20070528_ip.txt / x/TEST/batch/temp/20070528__op.txt] | Encerrado | 05/28/2007 02:27:27 | TESTE | 24745 -------------------------------------------------- ------- Executar Número: 3 --------------------------------------- -------------------- test_run-layout test_vaal-i [/ x/TEST/batch/temp/20070528_ip.txt / x/TEST/batch/temp/20070528__op.txt] | Começar | 05/28/2007 02:56:32 | TESTE | 5560 -------------------------------------------------- ------- out_file ------------------------------------------ ----------------- item_id | status_desc | descrição test_run-layout test_vaal-i [/ x/TEST/batch/temp/20070528_ip.txt / x/TEST/batch/temp/20070528__op.txt] | Encerrado | 05/28/2007 02:56:34 | TESTE | 5560 -------------------------------------------------- ------- Executar Número: 4 --------------------------------------- -------------------- test_run-layout test_vaal-i [/ x/TEST/batch/temp/20070528_ip.txt / x/TEST/batch/temp/20070528__op.txt] | Começar | 05/28/2007 02:57:32 | TESTE | 11961 -------------------------------------------------- ------- out_file ------------------------------------------ ----------------- item_id | status_desc | descrição test_run-layout test_vaal-i [/ x/TEST/batch/temp/20070528_ip.txt / x/TEST/batch/temp/20070528__op.txt] | Encerrado | 05/28/2007 02:57:33 | TESTE | 11961 -------------------------------------------------- ------- Executar Número: 5 --------------------------------------- -------------------- test_run-layout test_vaal-i [/ x/TEST/batch/temp/20070528_ip.txt / x/TEST/batch/temp/20070528__op.txt] | Começar | 05/28/2007 04:17:31 | TESTE | 24685 -------------------------------------------------- ------- out_file ------------------------------------------ ----------------- item_id | status_desc | descrição test_run-layout test_vaal-i [/ x/TEST/batch/temp/20070528_ip.txt / x/TEST/batch/temp/20070528__op.txt] | Encerrado | 05/28/2007 04:17:33 | TESTE | 24685 Entrada para o guião será test_run-layout test_vaal-i [/ x/TEST/batch/temp/20070528_ip.txt / x/TEST/batch/temp/20070528__op.txt] Meu trabalho consiste em extrair a última ocorrência da expressão que é a partir IP_EXPR | Started tp IP_EXPR | Completed Tentei com sed mas dá o seguinte erro sed:-E expressão # 1, char 40: caracteres extras após o comando Na sequência é o meu código IP \u003d "test_run-layout test_vaal-i [/ x/TEST/batch/temp/20070528_ip.txt / x/TEST/batch/temp/20070528__op.txt]" IP_FILE \u003d "test.txt" EXPR \u003d `echo $ IP | sed 's / \ [/ / g' | sed 's / \] / / g' ` echo "expr é: $ (EXPR)" EXTRAÍDO \u003d `cat $ IP_FILE | sed 's / \ [/ / g' | sed 's / \] / / g' |sed 's / /! / g' | sed -n "/ $ (EXPR }/,/${ EXPR) / p" ` echo "EXTRAÍDO é: $ (EXTRAÍDO)" Alguém pode me ajudar neste Raghu |
| Marcadores |
| Thread Tools | Pesquisar este Thread |
| Display Modes | Esta taxa Thread |
|
|