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

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

Re: [shell-script] Comandos em variáveis executados dinamicamente


From: Raul Libório
Subject: Re: [shell-script] Comandos em variáveis executados dinamicamente
Date: Wed, 22 Jun 2016 14:01:48 -0300

Obrigado pessoal!

Ambos funcionaram muito bem, mas o método do Luis Tavares caiu como uma luva.
Obrigado!

Raul Libório
http://rauhmaru.blogspot.com/
openSUSE Member | Linux User #4444581

/etc/httpd/conf.d/ssl.conf:7
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.

2016-06-22 12:57 GMT-03:00 Jonathan Lessa address@hidden [shell-script] <address@hidden>:
 

outra forma:

# Data="" +%d-%m-%Y+%T'
# echo `$Data`
22-06-2016+12:56:49
# nome=`$Data`
# echo $nome
22-06-2016+12:56:54



Em 22 de junho de 2016 12:49, Luís Tavares address@hidden [shell-script] <address@hidden> escreveu:
 

Você pode envelopar ela numa função?

Data () {
echo $(date "+%d-%m-%Y %T")
}


Luís Alberto Tavares Poli


Em 22 de junho de 2016 11:37, Raul Libório address@hidden [shell-script] <address@hidden> escreveu:
 

Galera, bom dia,

Seguinte... Em um script, se eu declaro uma variável:
DATA="" date "+%d-%m-%Y %T" )
Quando eu a chamar, com um echo ${DATA}, virá o seu valor. Ok, tudo certo!
O problema é que o valor dessa variável será sempre o mesmo.
Como eu faço para que ela apresente o valor dinamicamente, que o comando dentro da variável seja executado novamente a cada chamada?

Abraços

Raul Libório
http://rauhmaru.blogspot.com/
openSUSE Member | Linux User #4444581

/etc/httpd/conf.d/ssl.conf:7
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.





--
Att.:
Jonathan Lessa
Licenciado em Informática



reply via email to

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