The UNIX and Linux Forums  
Olá e boas-vindas de Estados Unidos para o UNIX e Linux Forum! Obrigado por visitar e fazer parte da nossa comunidade global.

Go Back   O UNIX e Linux Forum > Top Fóruns > Programação Shell Script e
.
google unix.com



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
arquivo comparação script tiger99 Programação Shell Script e 1 01-30-2008 10:47
Problema no ksh script (String comparação) amarnath AIX 1 07-18-2006 06:40
Problema no ksh script (String comparação) amarnath Programação Shell Script e 3 07-13-2006 12:14
Ajuda com o tempo comparação script para HP-UX gummysweets Programação Shell Script e 6 10-12-2005 10:48
Instalando Patches de um script viRaven Programação Shell Script e 3 12-12-2003 12:52

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
Linkback Thread Tools Pesquisar este Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-18-2009
Sathvik Sathvik is offline
Usuário
  
 

Join Date: Jun 2008
Posts: 1
Comparação de 2 de domingo servidor patches usando script

Oi,

Não sei o que estou em falta, tentou debug, mas não foi bem sucedida, qualquer ajuda sobre isso será muito apreciada.

Código:
#!/bin/sh
rm -f /tmp/t?
host1=`cat $1|grep Hostname: | awk '{print $2}'`
host2=`cat $2|grep Hostname: | awk '{print $2}'`
rel1=`cat $1|grep Release: | awk '{print $2}'`
rel2=`cat $2|grep Release: | awk '{print $2}'`
arch1=`cat $1|grep "Kernel architecture:" | awk '{print $3}'`
arch2=`cat $2|grep "Kernel architecture:" | awk '{print $3}'`

cat $1 |grep "Patch:" | awk '{print $2}'  >/tmp/t1
cat $2 |grep "Patch:" | awk '{print $2}'  >/tmp/t2

cat /tmp/t1 | awk '{print $1}'| sort  >/tmp/t3
cat /tmp/t2 | awk '{print $1}'| sort  >/tmp/t4

prev=`head -1 t3`
for  i in `cat t3`
do
        curr=$i
        if [ $prev != $curr ]
        then
                currhead=`echo $curr | cut -f 1 -d "-"`
                prevhead=`echo $prev | cut -f 1 -d "-"`
                if [ $prevhead != $currhead ]
                then
                        echo $prev >> /tmp/ta
                fi
                prev=$curr
        fi
done

rm /tmp/t?
Quando eu executar este eu recebo a seguinte saída, e aí stucks si.

$. / Patchscript
+ Rm-f / tmp / t?
+ Gato
+ Grep Hostname:
+ Awk (print $ 2)

Última edição por DukeNuke2; em 03/21/2009 12:53..
 

Marcadores

Thread Tools Pesquisar este Thread
Pesquisar este Thread:

Pesquisa Avançada
Display Modes Esta taxa Thread
Esta taxa Thread:

Destacamento Regimento
Você não pode postar novas threads
Você não pode postar respostas
Você não pode postar anexos
Você não pode editar suas postagens

BB code é Ligado
Smilies são Ligado
[IMG] código é Ligado
Código HTML é Desligado
Trackbacks são Ligado
Pingbacks são Ligado
Refbacks são Ligado




Todos os horários são GMT -4. A hora é agora 04:35.


Powered by: vBulletinCopyright © 2000 - 2006, Jelsoft Enterprises Limited. Língua Traduções Powered by .
vBCredits v1.4 Copyright © 2007 - 2008, PixelFX Studios
O UNIX e Linux Fóruns Content Copyright © 1993-2009. Todos os Direitos Reserved.Ad Gestão por RedTyger

Content Relevant URLs por vBSEO 3.2.0