- Aug
- 64
- 2
In a batch file, using sed to extract a string from a file (sed writes its output to stdout), I would like to set an environment variable to that extracted string. Is that possible?
Eg. from a Windows scheduled task xml file, which contains the line:
<spaces><Author>Papa\burger</Author><nl>
using the sed command:
sed -n -e"s/^.*<Author>\([a-zA-Z0-9_]*\)\\[a-zA-Z0-9_]*<\/Author>$/\1/ip" filename.xml
produces the output:
Papa<nl>
How to set environmentvariable=Papa?
Eg. from a Windows scheduled task xml file, which contains the line:
<spaces><Author>Papa\burger</Author><nl>
using the sed command:
sed -n -e"s/^.*<Author>\([a-zA-Z0-9_]*\)\\[a-zA-Z0-9_]*<\/Author>$/\1/ip" filename.xml
produces the output:
Papa<nl>
How to set environmentvariable=Papa?