[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RES: [shell-script] queimando a cuca!!!
From: |
lferreir1 |
Subject: |
Re: RES: [shell-script] queimando a cuca!!! |
Date: |
Fri, 17 Sep 2004 18:26:11 -0000 |
User-agent: |
eGroups-EW/0.82 |
Thobias, ( agora foi apresentado pelo nosso colega Julio )
Aliás Julio, os seus cabelos já estão todos brancos? A sua foto no
livro Programação Shell Linux esta quase todo branco !!!
Voltando ao que interessa;
Thobias,
Não sei o que aconteceu aqui, mas o seu script deu erro.
cat numero_02
17 37
07 43
34 39
12 42
06 21
03 29
bash -x ./teste
+ echo 'Entre com o nome do arquivo a ser tratado: \c'
Entre com o nome do arquivo a ser tratado: \c
+ read ARQUIVO
numero_02
+ '[' '!' -e numero_02 ']'
++ sed -n '$=' numero_02
+ fim=6
++ seq 1 6
+ sed -n '1,${h;:a;{n;G;s/\(.*\)\n\(.*\)/\2 \1/p;ta;};}'
Label too long: 1,${h;:a;{n;G;s/\(.*\)\n\(.*\)/\2 \1/p;ta;};}
+ sed -n '2,${h;:a;{n;G;s/\(.*\)\n\(.*\)/\2 \1/p;ta;};}'
Label too long: 2,${h;:a;{n;G;s/\(.*\)\n\(.*\)/\2 \1/p;ta;};}
+ sed -n '3,${h;:a;{n;G;s/\(.*\)\n\(.*\)/\2 \1/p;ta;};}'
Label too long: 3,${h;:a;{n;G;s/\(.*\)\n\(.*\)/\2 \1/p;ta;};}
+ sed -n '4,${h;:a;{n;G;s/\(.*\)\n\(.*\)/\2 \1/p;ta;};}'
Label too long: 4,${h;:a;{n;G;s/\(.*\)\n\(.*\)/\2 \1/p;ta;};}
+ sed -n '5,${h;:a;{n;G;s/\(.*\)\n\(.*\)/\2 \1/p;ta;};}'
Label too long: 5,${h;:a;{n;G;s/\(.*\)\n\(.*\)/\2 \1/p;ta;};}
+ sed -n '6,${h;:a;{n;G;s/\(.*\)\n\(.*\)/\2 \1/p;ta;};}'
Label too long: 6,${h;:a;{n;G;s/\(.*\)\n\(.*\)/\2 \1/p;ta;};}
Sabe onde errei?
--- Em address@hidden, caio ferreira <idic@t...>
escreveu
> thobiast wrote:
> > $ cat lixo
> > 1 2
> > 3 4
> > 5 6
> > 7 8
> > 9 0
> >
> > $ ./x
> > 1 2 3 4
> > 1 2 5 6
> > 1 2 7 8
> > 1 2 9 0
> > 3 4 5 6
> > 3 4 7 8
> > 3 4 9 0
> > 5 6 7 8
> > 5 6 9 0
> > 7 8 9 0
> >
> > $ cat x
> > #!/bin/bash
> >
> > fim=$(sed -n '$=' lixo)
> > for i in $(seq 1 $fim);do
> > sed -n "$i,\${h;:a;$!{n;G;s/\(.*\)\n\(.*\)/\2 \1/p;ta;};}" <
lixo
> > done
>
> Comecei a estudar o seu script e percebi uma coisa :
>
> NAME
> seq - print a sequence of numbers
>
> SYNOPSIS
> seq [OPTION]... LAST
> seq [OPTION]... FIRST LAST
>
> DESCRIPTION
> Print numbers from FIRST to LAST, in steps of INCREMENT.
>
> If FIRST or INCREMENT is omitted, it defaults to 1. That
is, an omit-
> ted INCREMENT defaults to 1 even when LAST is smaller
than FIRST.
>
> for i in $(seq $fim);do
- RES: [shell-script] queimando a cuca!!!, Julio Cezar Neves - DATAPREVRJ, 2004/09/17
- RES: [shell-script] queimando a cuca!!!, Julio Cezar Neves - DATAPREVRJ, 2004/09/17
- Re: RES: [shell-script] queimando a cuca!!!, thobiast, 2004/09/17
- Re: RES: [shell-script] queimando a cuca!!!, caio ferreira, 2004/09/17
- Re: RES: [shell-script] queimando a cuca!!!, lferreir1, 2004/09/21
- Re: RES: [shell-script] queimando a cuca!!!, Cleber P. de Souza, 2004/09/21
- Re: RES: [shell-script] queimando a cuca!!!, lferreir1, 2004/09/21
- Re: RES: [shell-script] queimando a cuca!!!, Thobias Salazar Trevisan, 2004/09/21
Re: RES: [shell-script] queimando a cuca!!!, caio ferreira, 2004/09/17