[GTER] Retorno para variavel em MS-DOS

Raul Libório rauhmaru at opensuse.org
Tue Jan 5 13:37:13 -02 2010


Complementando:

Windows PowerShell Owner's Manual
http://technet.microsoft.com/pt-br/library/ee221100%28en-us%29.aspx

Script Center Repository:
http://gallery.technet.microsoft.com/ScriptCenter/en-us/site/search?f[0].Type=ScriptLanguage&f[0].Value=Powershell&f[0].Text=Windows%20PowerShell

Download
http://www.microsoft.com/downloads/details.aspx?FamilyId=DF8ED469-9007-401C-85E7-46649A32D0E0&displaylang=en



2010/1/5 Raul Libório <rauhmaru at gmail.com>:
> E o Windows Power Shell? Não rola não?
>
> 2010/1/5 Roberto Machado <rcrivano at gmail.com>:
>> Oi!
>>
>> Você deve poder usar o FOR. Terá que dar uma olhada nos detalhes. Para
>> pegar o output inteiro do "dir", por exemplo, talvez você tenha que
>> mexer nos delimitadores de campo e no eol. Talvez você possa ler o
>> output linha e a linha e concatenar tudo numa variável só usando o
>> "set". Dê uma olhada em:
>>
>> http://ss64.com/nt/for_cmd.html
>>
>> Veja só este trecho:
>>
>> "The FOR command is the answer to innumerable questions where you want
>> to take the output of some command, store it in a variable (%%G) then
>> do something with the result."
>>
>> Aproveitando, este parece ser um tópico para a MASOCH e não a GTER.
>>
>> []s, Roberto
>>
>> 2010/1/5 Marcelo Costa <mcosta at mcosta.eng.br>:
>>> Fabrício,
>>>
>>> Retornar em variável não tem jeito, mas pode-se gravar a saída em um arquivo
>>> e depois tratar o arquivo.
>>> Creio que resolve o seu problema.
>>> Era assim que eu fazia nos auges tempos da informática e antes dos
>>> Linux/Unix
>>>
>>> Atenciosamente,
>>>
>>> Eng. Marcelo Costa
>>> ======================================
>>> MCosta Ind. Com.
>>> Av. João Firmino, 1393 Bairro Assunção
>>> São Bernardo do Campo - SP
>>> CEP 09812-460
>>> Fone/Fax: 11-4356-5536
>>>
>>>
>>>
>>> Edinilson - ATINET escreveu:
>>>>
>>>> http://www.the-scream.co.uk/forums/t21196.html
>>>>
>>>>
>>>> Edinilson
>>>> ---------------------------------------------------------
>>>> ATINET-Professional Web Hosting
>>>> Tel Voz: (0xx11) 4412-0876
>>>> http://www.atinet.com.br
>>>>
>>>>
>>>> ----- Original Message ----- From: "Fabricio Veiga"
>>>> <fabriciostuff at gmail.com>
>>>> To: <gter at eng.registro.br>
>>>> Sent: Tuesday, January 05, 2010 8:44 AM
>>>> Subject: [GTER] Retorno para variavel em MS-DOS
>>>>
>>>>
>>>> Bom dia senhores!
>>>>
>>>> Como obter o retorno de algum comando, por exemplo dir, para uma variável
>>>> no
>>>> MS-DOS ?
>>>> Pesquisando através do Google, não encontrei informações de como realizar
>>>> esta atribuição.
>>>>
>>>> Ex.: set %teste%=dir
>>>> OBS.: Desta maneira, é exibido ao imprimir a variável, o contéudo "dir".
>>>>
>>>> Obrigado a todos.
>>>>
>>>> Att,
>>>>
>>>> Fabrício Veiga
>>>> --
>>>> gter list    https://eng.registro.br/mailman/listinfo/gter
>>>>
>>>> --
>>>> gter list    https://eng.registro.br/mailman/listinfo/gter
>>>>
>>>>
>>>
>>> --
>>> gter list    https://eng.registro.br/mailman/listinfo/gter
>>>
>> --
>> gter list    https://eng.registro.br/mailman/listinfo/gter
>>
>
>
>
> --
> Raul Libório
> http://rauhmaru.blogspot.com/
> rauhmarutsªhotmailºcom
> Linux user#4444581
>
> "There are only 10 types of people in the world -
> Those who understand binary, and those who don't."
>



-- 
Raul Libório
http://rauhmaru.blogspot.com/
rauhmarutsªhotmailºcom
Linux user#4444581

"There are only 10 types of people in the world -
Those who understand binary, and those who don't."



More information about the gter mailing list