Sponsored Content
Top Forums Shell Programming and Scripting Url encoding a string using sed Post 303013271 by RudiC on Monday 19th of February 2018 04:53:25 AM
Old 02-19-2018
I'm not sure your curl command does what you intend it to do, as e.g. the pairs of single quotes don't match up. Once you sourced your "key / value pair" file so all the needed shell variables are defined, use Chubler_XL's function (in a "command substitution"!) to encode the variables in question:
Code:
curl 'http://192.168.1.55/epace/do-login  lastLoggedInCompany=public;~~ JSESSIONID='$JSESSIONID0' -H Origin: http://192.168.1.55 -H~~Referer: http://192.168.1.55/epace/login.html -H Connection: keep-alive --data j_username=ticorder&j_password='$(url_var $j_password)'&lastLoggedInCompany=public&iv='$iv'&salt='$salt'&hash= --compressed'

Not sure if I entirely and correctly understood your request, nor if the other variables used wouldn't need a URL-encoding as well.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

parsing url string

Hi, I have a url like this:- http://resource.ibab.ac.in/cgi-bin/pubmed_abstract/y.cgi?pmid=+1.10529272+&pmid=+3.8379586 I want to parse the url string.I want to get the values 1.10529272 3.8379586 How do i do that? (5 Replies)
Discussion started by: vanitham
5 Replies

2. Shell Programming and Scripting

URL encoding

Hi All, I want to do URL encoding using shell script in my project. I decided that the sed is the correct tool to do this. But I am unable achieve what I wanted using sed. kindly help me to get rid of this. My requirement is , there will be one URL with all special character, spaces etc... ... (8 Replies)
Discussion started by: Vichu
8 Replies

3. UNIX for Advanced & Expert Users

.htaccess url encoding

Hi, I tried hard to find out solution but no success. I have put together this code in .htaccess: Rewritecond %{THE_REQUEST} ^{3,9}\ /index\.php\?(+)query=(.*?)&(+)start=(.*?)&(+)\ HTTP/ Rewriterule ^index\.php$ http://subdomain.domain.com/%2/%4? RewriteRule ^(+)/(*)$... (0 Replies)
Discussion started by: LukasB
0 Replies

4. Shell Programming and Scripting

python - string encoding error

I'm trying to pull a google calendar (successful) and then put the contents into a mysql db (almost successful). On one of the field I keep getting an encode error: #!/usr/bin/python from xml.etree import ElementTree import gdata.calendar.data import gdata.calendar.client import... (12 Replies)
Discussion started by: unclecameron
12 Replies

5. Shell Programming and Scripting

How to achieve UTF-8 encoding & URL escape in an xml file?

Is there any i can achieve entity escaping, URL escaping & UTF-8 encoded for the xml generated through shell script? #! /bin/bash echo "<path>" >> file.xml for x in `ls filename*` do echo -e "\t<dir>" >> file.xml echo -e "\t\t<file>$x</file>" >> file.xml... (0 Replies)
Discussion started by: vel4ever
0 Replies

6. Shell Programming and Scripting

How to check string encoding?

I want to check if the string is WINDOWS-1251 or UTF-8 can you help me to find the string encoding??? or maybe to get URL Content-Type charset with wget? this is my function on PHP function check_utf8($str) { $len = strlen($str); for($i = 0; $i < $len; $i++){ $c =... (2 Replies)
Discussion started by: sanantonio7777
2 Replies

7. Shell Programming and Scripting

URL/HTML encoding

Hey guys, looking for a way to encode a string into URL and HTML in a bash script that I'm making to encode strings in various different digests etc. Can't find anything on it anywhere else on the forums. Any help much appreciated, still very new to bash and programming etc. (4 Replies)
Discussion started by: 3therk1ll
4 Replies

8. Shell Programming and Scripting

Replace URL using sed

Original Line {background-image:url('http://www.myoldhost.com/images/scds/tsp3.png');} Expected {background-image:url('http://www.mynewhost.com/nndn/hddh/ccdcd.png');} I am using following syntax STATIC_HOST_TEMP="http://myhost.com/temp/xyx.png" $sed -e... (1 Reply)
Discussion started by: 8055
1 Replies

9. Shell Programming and Scripting

Use curl to send a static xml file using url encoding to a web page using pos

Hi I am try to use curl to send a static xml file using url encoding to a web page using post. This has to go through a particular port on our firewall as well. This is my first exposure to curl and am not having much success, so any help you can supply, or point me in the right direction would be... (1 Reply)
Discussion started by: Paul Walker
1 Replies

10. Solaris

View file encoding then change encoding.

Hi all!! I´m using command file -i myfile.xml to validate XML file encoding, but it is just saying regular file . I´m expecting / looking an output as UTF8 or ANSI / ASCII Is there command to display the files encoding? Thank you! (2 Replies)
Discussion started by: mrreds
2 Replies
RLM_IPPOOL_TOOL(8)					      System Manager's Manual						RLM_IPPOOL_TOOL(8)

NAME
rlm_ippool_tool - dump the contents of the FreeRadius ippool database files SYNOPSIS
If an ipaddress is specified then that address is used to limit the actions or output. rlm_ippool_tool [-a] [-c] [-o] [-v] session-db index-db [ipaddress] Mark the entry nasIP/nasPort as having ipaddress rlm_ippool_tool -n session-db index-db ipaddress nasIP nasPort Update old format database to new. rlm_ippool_tool -u session-db new-session-db DESCRIPTION
rlm_ippool_tool dumps the contents of the FreeRADIUS ippool databases for analyses or for removal of active (stuck?) entries. Or with the -n argument adds a usage entry to the FreeRADIUS ippool databases. OPTIONS
-a Print all active entries. -c Report number of active entries. -r Remove active entries. -v Verbose report of all entries. -o Assume old database format (nas/port pair, not md5 output). -n Mark the entry nasIP/nasPort as having ipaddress. -u Update old format database to new. EXAMPLES
Given the syntax in the FreeRadius radiusd.conf: ippool myippool { range-start = 192.168.1.0 range-stop = 192.168.1.255 [...] session-db = ${raddbdir}/ip-pool.db ip-index = ${raddbdir}/ip-index.db } To see the number of active entries in this pool, use: $ rlm_ippool_tool -c ip-pool.db ip-index.db 13 To see all active entries in this pool, use: $ rlm_ippool_tool -a ip-pool.db ip-index.db 192.168.1.5 192.168.1.82 192.168.1.244 192.168.1.57 192.168.1.120 192.168.1.27 [...] To see all information about the active entries in the use, use: $ rlm_ippool_tool -av ip-pool.db ip-index.db NAS:172.16.1.1 port:0x2e8 - ipaddr:192.168.1.5 active:1 cli:0 num:1 NAS:172.16.1.1 port:0x17c - ipaddr:192.168.1.82 active:1 cli:0 num:1 NAS:172.16.1.1 port:0x106 - ipaddr:192.168.1.244 active:1 cli:0 num:1 NAS:172.16.1.1 port:0x157 - ipaddr:192.168.1.57 active:1 cli:0 num:1 NAS:172.16.1.1 port:0x2d8 - ipaddr:192.168.1.120 active:1 cli:0 num:1 NAS:172.16.1.1 port:0x162 - ipaddr:192.168.1.27 active:1 cli:0 num:1 [...] To see only information of one entry, use: $ rlm_ippool_tool -v ip-pool.db ip-index.db 192.168.1.1 NAS:172.16.1.1 port:0x90 - ipaddr:192.168.1.1 active:0 cli:0 num:0 To add an IP address usage entry, use: $ rlm_ippool_tool -n ip-pool.db ip-index.db 192.168.1.1 172.16.1.1 0x90 rlm_ippool_tool: Allocating ip to nas/port: 172.16.1.1/144 rlm_ippool_tool: num: 1 rlm_ippool_tool: Allocated ip 192.168.1.1 to client on nas 172.16.1.1,port 144 SEE ALSO
radiusd(8) AUTHORS
Currently part of the FreeRADIUS Project (http://www.freeradius.org) Originally by Edwin Groothuis, edwin@mavetju.org (http://www.mavetju.org) Mailing list details are at http://www.freeradius.org/ RLM_IPPOOL_TOOL(8)
All times are GMT -4. The time now is 12:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy