Hi ,

I want to write following contents in a file through shell script.

below is the content
-------------------------------------------------------
DATE: Wed August 01 2:20 PST 2011
PRODUCT: Quick
PRODUCT_VERSION:21.0
PROJECT: QW12
BUILD: 21.1.3.10
PATH: r:\\QW\21.1.3.10
--------------------------------------------------------

Where Build is variable . It should fetch the data from system(i.e. current version no.).
for path PATH: r:\\QW\”version no.”

Let me know your inputs on this.

Regards,
Sachin

Is this a Windows Power Shell script?
You can create a variable with the BUILD number in it then use the variable in your PATH line. In bash the path line would look like:

PATH: r:\\QW\${BUILD}

Not sure where the BUILD number comes or how/if variables are created/used in Windows Power Shell...

Hi ,

I do agree with you. PATH: r:\\QW\${BUILD} will give the build version number. How to copy all these contents in a new file say (QWtest.txt).

please let me know.

echo "PATH: r:\\QW\${BUILD}" >> filename.txt

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.