the "help" program should tell you much about all this... i'm not sure there's the equivalent of backquotes in MS-DOS, but there should be a way to retrieve information from the last executed program ... though i'm unsure of whether this is restricted to the "return code" or if it also applies to the output.
At worst, there is probably a way to prompt a specific item from the user, and you could easily pipe the output of your statement to that "input-and-set-env-variable" program ...
Ok I ended up writing that output to a file and reading from it.
Anyway I am trying to append the string ":0.0" to the string from the file but dont know how to do this.
Anyone know how to append the string ":0.0" to the another string in DOS?
your sed statement says s/ (substitute) .*: (everything before ':') // (with nothing) ...
Instead you should say "substitute '<anything> : <address>' with '<address>:0.0'
s/regexp/replacement/
Attempt to match regexp against the pattern space. If successful, replace that
portion matched with replacement. The replacement may contain the special charac-
ter & to refer to that portion of the pattern space which matched, and the special
escapes \1 through \9 to refer to the corresponding matching sub-expressions in
the regexp.
If you know enough of regexps, then ".*: ([0-9\.]*)" should be clearly <anything> : <IP> for you.
That suggests me 's/.*: \([0-9\.]*\)/\1:0.0/' should do the trick
Can I ask you why don't you use cygwin win to do this. moreover you use sed from cygwin which needs a the cygwin dll anyway so why not use the enviroment. From what I can see you are trying to automate adding the display number to an the host's ip adress. Which means that you need a X server running. Cygwin has a X server that you can use for this.
B.E wrote:
Can I ask you why don't you use cygwin win to do this. moreover you use sed from cygwin which needs a the cygwin dll anyway so why not use the enviroment. From what I can see you are trying to automate adding the display number to an the host's ip adress. Which means that you need a X server running. Cygwin has a X server that you can use for this.
Yes that is what I thought of doing at first, but thought it would be better to do it at CYGWIN start from DOS rather than making it shell specific (like .bashrc/.cshrc)