shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

comando awk com print


From: Luiz
Subject: comando awk com print
Date: Sat, 11 Feb 2012 00:24:40 -0000
User-agent: eGroups-EW/0.82

Caros da lista


  Se executar o comando abaixo,
ssh -o ConnectTimeout=10 -p 5960 suporte@192.168.1.72  ''uptime | awk '{print 
$10,$11,$12}'''

  Obtenho o resultado

   0.00, 0.00, 0.00

  Mas se executar o comando atraves de um programa pascal

sh -c "ssh -o ConnectTimeout=10 -p 5960 suporte@192.168.1.72  ''uptime | awk 
'{print $10,$11,$12}'''"

  Obtenho 0 1 2
  
  Se executar com aspas simples

sh -c 'ssh -o ConnectTimeout=10 -p 5960 suporte@192.168.1.72  ''uptime | awk 
'{print $10,$11,$12}''''

  Obtenho o erro

awk: cmd. line:1: {print
awk: cmd. line:1:       ^ unexpected newline or end of string

  Poderiam me auxiliar ?

Weber




reply via email to

[Prev in Thread] Current Thread [Next in Thread]