Reputation: 5037
I'm trying to write to a file a URL string that has the '&' char in it (using simple 'echo'), problem is that it's a saved char in the command prompt so it fails.
Is there any way to tell the command prompt that it's part of the string.
Example:
echo www.google.com/search=make&peace > love.txt
I'll get an error indicating that "peace" is not a recognized command.
Thanks!
Upvotes: 5
Views: 30663
Reputation: 144
Just enclose the URL in Quotes:
echo "www.google.com/search=make&peace" > love.txt
Upvotes: 4
Reputation: 130004
cmd uses ^ as the escape character, so
echo www.google.com/search=make^&peace > love.txt
Upvotes: 20