- Thread Author
- #1
Hi,
I mostly use another OS, and need to rewrite following script into one which works in windows.
OK, here's the command:
curl -s -x 127.0.0.1:8888 -b ./cookies.txt -X GET Link Removed 2>&1 | tr -d '[]' | sed "s/,/\n/g" | head -n 1 | sed "s/.\(.*\)./\1/"
here's what it does: loads content of some URL using curl and redirect output 2 to std one. This return json like: '["a", "b", "c"]' this result is piped to following commands resulting to single line output:
a
Commands are little bit crazed, because tr does not work with \", i don't know why. *But* given command *works*. What I need to do, is to store its result to variable. (need to be used later).I've tried to do:
set myVariable=...
but that stores empty string into it instead of valid value.
I've found some workaround using for cycle, but that did not liked redirection of output.
Does anybody know solution(even really complicated one) to this simple problem?
I mostly use another OS, and need to rewrite following script into one which works in windows.
OK, here's the command:
curl -s -x 127.0.0.1:8888 -b ./cookies.txt -X GET Link Removed 2>&1 | tr -d '[]' | sed "s/,/\n/g" | head -n 1 | sed "s/.\(.*\)./\1/"
here's what it does: loads content of some URL using curl and redirect output 2 to std one. This return json like: '["a", "b", "c"]' this result is piped to following commands resulting to single line output:
a
Commands are little bit crazed, because tr does not work with \", i don't know why. *But* given command *works*. What I need to do, is to store its result to variable. (need to be used later).I've tried to do:
set myVariable=...
but that stores empty string into it instead of valid value.
I've found some workaround using for cycle, but that did not liked redirection of output.
Does anybody know solution(even really complicated one) to this simple problem?