Breaking Long Lines in Batch

M

moleskyca1

I have long lines in my .bat file. This works, but it is diffucult to
read. How can I break them into multiple line, like:

set "RUNTIME_ENV=-param1=sql4,new_12rts -param2=sql5,new_12rts -
param3=sql5,new_12rts -param6=orcl_enum12 -param7=orcl_enumA17 -
param8=.\src\extern\lib\oswindowsnt"

Line is longer. Is there something like in makefile when you do '\'
and then tab the next line?

Thank you.
 
M

Matthias Tacke

I have long lines in my .bat file. This works, but it is diffucult to
read. How can I break them into multiple line, like:

set "RUNTIME_ENV=-param1=sql4,new_12rts -param2=sql5,new_12rts -
param3=sql5,new_12rts -param6=orcl_enum12 -param7=orcl_enumA17 -
param8=.\src\extern\lib\oswindowsnt"

Line is longer. Is there something like in makefile when you do '\'
and then tab the next line?
The group alt.msdos.batch is dedicated to DOS/Win9x/WinME and these OS'
don't support enhancements present in NT/W2K/XP/..

Please crosspost only when really neccessary and include a follow up then.
This question could be easily googled by searching for "line continuation
char".

Assuming you are looking for a solution for the nt-line, this will do (but
only without the quoting you used):

set RUNTIME_ENV=-param1=sql4,new_12rts^
-param2=sql5,new_12rts^
-param3=sql5,new_12rts^
-param6=orcl_enum12^
-param7=orcl_enumA17^
-param8=.\src\extern\lib\oswindowsnt
echo %RUNTIME_ENV%


Xpost and f'up2 alt.msdos.batch.nt
 
F

foxidrive

I have long lines in my .bat file. This works, but it is diffucult to
read. How can I break them into multiple line, like:

set "RUNTIME_ENV=-param1=sql4,new_12rts -param2=sql5,new_12rts -
param3=sql5,new_12rts -param6=orcl_enum12 -param7=orcl_enumA17 -
param8=.\src\extern\lib\oswindowsnt"

Line is longer. Is there something like in makefile when you do '\'
and then tab the next line?

Thank you.

Try this: enclosing the term in quotes breaks the line ending character ^

@echo off
set RUNTIME_ENV=-param1=sql4,new_12rts -param2=sql5,new_12rts ^
param3=sql5,new_12rts -param6=orcl_enum12 -param7=orcl_enumA17 ^
param8=.\src\extern\lib\oswindowsnt

echo %RUNTIME_ENV%
 
Top