PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms..win.server.scripting > shell script
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
shell script

Réponse
 
LinkBack Outils de la discussion
Vieux 16/11/2007, 23h57   #1
ned
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut shell script

Hi all

I am not sure this is OT

Is there a way to concatenate the output from two commands into a single
line in a batch file?


Something like

echo A <concatenate> echo B >> file.txt

that would create one line

AB

instead of two lines

A
B

in file.txt?

Thanks

BTW I could not find a dos-shell NG... obsolete? :-)
  Réponse avec citation
Vieux 17/11/2007, 01h32   #2
Tom Lavedas
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: shell script

On Nov 16, 6:57 pm, ned <n...@nospam.com> wrote:
> Hi all
>
> I am not sure this is OT
>
> Is there a way to concatenate the output from two commands into a single
> line in a batch file?
>
> Something like
>
> echo A <concatenate> echo B >> file.txt
>
> that would create one line
>
> AB
>
> instead of two lines
>
> A
> B
>
> in file.txt?
>
> Thanks
>
> BTW I could not find a dos-shell NG... obsolete? :-)


There is no easy way to concatenate lines in batch - though it can be
done, just not easily.

One place to get with this is alt.msdos.batch/nt

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
  Réponse avec citation
Vieux 20/11/2007, 22h48   #3
Jeffery Hicks [MVP]
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: shell script

Are you really needing to get things done on one line, or do you need to
save output from two different commands to the same file?

DIR %temp% > file.txt
Ping localhost >> file.txt

Maybe a bit more background on the actual commands you're trying to work
with will .

--
Jeffery Hicks
Microsoft PowerShell MVP
http://www.scriptinganswers.com
http://www.powershellcommunity.org

Now Available: WSH and VBScript Core: TFM
Coming Soon: Windows PowerShell: TFM 2nd Ed.
"Tom Lavedas" <tglbatch@cox.net> wrote in message
news:1a6152aa-78ba-40aa-b133-6fc6615f5f4f@a28g2000hsc.googlegroups.com...
> On Nov 16, 6:57 pm, ned <n...@nospam.com> wrote:
>> Hi all
>>
>> I am not sure this is OT
>>
>> Is there a way to concatenate the output from two commands into a single
>> line in a batch file?
>>
>> Something like
>>
>> echo A <concatenate> echo B >> file.txt
>>
>> that would create one line
>>
>> AB
>>
>> instead of two lines
>>
>> A
>> B
>>
>> in file.txt?
>>
>> Thanks
>>
>> BTW I could not find a dos-shell NG... obsolete? :-)

>
> There is no easy way to concatenate lines in batch - though it can be
> done, just not easily.
>
> One place to get with this is alt.msdos.batch/nt
>
> Tom Lavedas
> ===========
> http://members.cox.net/tglbatch/wsh/


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 10h32.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11324 seconds with 11 queries