user2524314
user2524314

Reputation: 135

GNU parallel escaped character that is not intend to escape

parallel --dry-run wget {1} :::: <(echo "http:://a&b")

produces

wget http:://a\&b  

How do I prevent the \ before &? I've tried the option -q, but the output is the same.

Upvotes: 2

Views: 1041

Answers (1)

Ole Tange
Ole Tange

Reputation: 33685

You use eval:

parallel --dry-run eval wget {1} :::: <(echo "http:://a&b")

In URLs you typically want the escaping, though, because otherwise you are starting wget in the background and running the command b.

Here is a (contrived) example where it does make sense:

parallel eval echo {} :::: <(echo "this & echo that")

A less contrived example is in the man page: https://www.gnu.org/software/parallel/man.html#EXAMPLE:-Aggregating-content-of-files

Upvotes: 3

Related Questions