The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 07-23-2008
joeyg's Avatar
joeyg joeyg is offline Forum Staff  
modérateur
  
 

Join Date: Dec 2007
Location: Home of 17-time world champion Boston Celtics
Posts: 1,311
Cool Does this help?

Code:
> inval="http://127.0.0.1/test.cgi?param1=test & test co"
> echo "$inval"
http://127.0.0.1/test.cgi?param1=test & test co
> outval=$(echo "$inval" | sed "s/ /%20/g" | sed "s/&/%26/g")
> echo "$outval"
http://127.0.0.1/test.cgi?param1=test%20%26%20test%20co