How to script the creation of a text file, with 4/5 lines of text

From: Stephen Copp (scopp_at_ea.com)
Date: 09/30/03


Date: Mon, 29 Sep 2003 19:44:23 -0700

Hello all,

I'm trying to script the creation of a file with a few lines of text. The
thing is that this text contains special characters and filepaths. For
example, the text file I want to create looks something like the following:

THIS = ( that )
PATH = ( /this/is/a/test/test.jar )
(${PATH}) -> (${THIS})
test....

This is what I get when I do the following:
# echo "THIS = ( that ) PATH = ( /this/is/a/test/test.jar ) (${PATH}) ->
(${THIS}) test...." > test.out
THIS: Undefined variable

Adding a '/' in front of the '$' doesn't help either:
# echo "THIS = ( that ) PATH = ( /this/is/a/test/test.jar ) (/${PATH}) ->
(/${THIS}) test...." > test.out
THIS: Undefined variable

I'm trying to do this within a script, so I can't use the following because
I need a ctrl-C to break:
cat > test.out
THIS = ( that )
PATH = ( /this/is/a/test/test.jar )
(${PATH}) -> (${THIS})
test....

Does anyone know how I get around this? Thanks for any help you can give
me.

-Stephen



Relevant Pages

  • Re: Are vbscript classes fast?
    ... Generally speaking, there is an overhead cost to creating a new scope, be it a function or a class, but the mere act of creating the scope is fairly rapid. ... I compared a generic function that just returned an empty value written in script and written as a method of a compiled component, and not surprisingly, the script function was slower by a factor of two - most likely due to scope creation. ... The MOST expensive way to create an object is to use WScript.CreateObject or Server.CreateObject instead of the native CreateObject in VBScript. ...
    (microsoft.public.scripting.vbscript)
  • Re: Create role on 64 bit extremely slow
    ... working properlly (except role creation), except that any change in a role ... made the whole AS server slow/ not responding (also other databases). ... generate the script and execute the script. ...
    (microsoft.public.sqlserver.olap)
  • Re: Form mailto and diacritical marks ?
    ... Some may not have their email software configured to send special characters such as the ones you mentioned. ... You need to 'POST' the form to a scrip on YOUR server so that you can deal with these special characters. ... That is a hidden field included in the form. ... But as you're not using a server side script to process form data this field is ignored. ...
    (alt.html)
  • Re: Copying the Latest FIle in a Directory in Win 2000/2003
    ... >>> Windows' default scheduler. ... >> batch script, since your requirement is to use the later of the created OR ... > assume that the modified date could not precede the creation date, ... > dates in a sortable format, like yyyy-mm-dd and times in 24hour format with ...
    (microsoft.public.windows.server.scripting)
  • Re: annoying cut and paste behavior in query analyzer
    ... brackets, verbose collation - whatever... ... Our first-commandment in our shop is to script everything. ... INSERT's, INDEX creation, table creation - STORED PROC creation. ... >> SQL Server MVP ...
    (microsoft.public.sqlserver.server)