//Random Tip
Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow

You are viewing a random entry, refresh your browser to change.

Ever wanted to look at a long HTML URL more easily, say to investigate a parameter. Here is a search from MapQuest.

http://www.mapquest.com/maps/map.adp?formtype=address&addtohistory=&address=10%20Market%20St&city=San%20Francisco&state=CA&zipcode=94111

We can split this using:

$ echo "[insert url here]" | tr "&?" "\n"

This produced for the above URL the following output.

http://www.mapquest.com/maps/map.adp
formtype=address
addtohistory=
address=10%20Market%20St
city=San%20Francisco
state=CA
zipcode=94111


View Comments »




Comments 

Add your comment

Comments are currently disabled
Thomas Defranc
it must be:

echo "[insert url here]"| tr "?" "\n"|tr "&" "\n"

else the "&" characters won't be translated to newlines.
Posted 2009-04-08 12:01:26
Rocket Ray
<nods to T. Defranc> Right.  Simply changing it to:

echo "<long url>" | tr "? &" "\n"

works for me.
Posted 2009-04-08 19:39:56

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit