Sponsored Content
Top Forums Shell Programming and Scripting Help with shell script for url processing Post 302399917 by thillai_selvan on Tuesday 2nd of March 2010 01:31:24 AM
Old 03-02-2010
You can achieve this using Perl as follows
Code:
my $string = "http://google.be";
if ( $string =~ s/(http:\/\/)(google.be)/$1sometext.$2/ )
{
print $string;
}

Now the string will contain the following

http://sometext.google.be
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

url calling and parameter passing to url in script

Hi all, I need to write a unix script in which need to call a url. Then need to pass parameters to that url. please help. Regards, gander_ss (1 Reply)
Discussion started by: gander_ss
1 Replies

2. Shell Programming and Scripting

URL call from SHELL script

My system does not have wget, curl and lynx. The chances are low that the SA would install them for me. Do I have any other way out? I need to invoke a few URL calls from my SHELL script. Thought of using a PERL script or writing a simple Java client, but that adds in more dependencies. Any... (37 Replies)
Discussion started by: chengwei
37 Replies

3. Shell Programming and Scripting

Shell Script to hit a url

Hi all, I have a php file that grabs xml, parses it and updates my db accordingly. I want to automate the execution of this process, rather than having to hit the url manually. I have been looking into using cron to execute a script to do this, however i'm not exactly sure what command i would... (1 Reply)
Discussion started by: restivz77
1 Replies

4. Shell Programming and Scripting

picking file from a particular URL and the processing

body { margin: 0 0 0 0; padding:0 0 0 0 }td,div { font-family:Courier New;font-size:10pt;vertical-align:top }body { margin: 0 0 0 0; padding:0 0 0 0 }.transcript { background-color:#d2d2d2; }.messageBlock { margin-left:4px; margin-bottom:3px }.message { margin-left:100px; word-wrap:break-word;... (0 Replies)
Discussion started by: priyanka3006
0 Replies

5. Shell Programming and Scripting

Refresh a URL from shell script

I have a php page which i run in a browser, it has a the refresh meta tag which refreshes the page after every 15 mins. Now i am running this on a browser. It will refresh and do something and update the database every 15 mins. So now is there any way i can simulate this using a simple shell... (2 Replies)
Discussion started by: tonan
2 Replies

6. Shell Programming and Scripting

How to find invalid URL in a text file using shell script?

How to find and remove invalid URLs in a text file using shell script? (1 Reply)
Discussion started by: vel4ever
1 Replies

7. Shell Programming and Scripting

Shell script for cron url

Hi guys, I have a serious issue with running cron command. My host not supported format below mentioned, just the URL.) http://www.mysite/example.php ( I’m affraid a bit, the host do not going to support the sh as well…anyway) Somehow I need to „wrap” this command, to able to call cron: ... (1 Reply)
Discussion started by: vazzeg
1 Replies

8. Shell Programming and Scripting

fire an URL using shell script

Hi, Can anyone tell me how to fire an URL using a shell script? :wall: (8 Replies)
Discussion started by: arijitsaha
8 Replies

9. Shell Programming and Scripting

How to Parse the XML data along with the URL in Shell Script?

Hi, Can anybody help to solve this. I want to parse some xmldata along with the URL in the Shell. I'm calling the URL via the curl command Given below is my shell script file export... (7 Replies)
Discussion started by: Megala
7 Replies

10. Programming

awk processing / Shell Script Processing to remove columns text file

Hello, I extracted a list of files in a directory with the command ls . However this is not my computer, so the ls functionality has been revamped so that it gives the filesizes in front like this : This is the output of ls command : I stored the output in a file filelist 1.1M... (5 Replies)
Discussion started by: ajayram
5 Replies
Tenjin::Util(3pm)					User Contributed Perl Documentation					 Tenjin::Util(3pm)

NAME
Tenjin::Util - Utility methods for Tenjin. VERSION
version 0.070001 SYNOPSIS
# in your templates: # encode a URL [== encode_url('http://www.google.com/search?q=tenjin&ie=utf-8&oe=utf-8&aq=t') =] # returns http%3A//www.google.com/search%3Fq%3Dtenjin%26ie%3Dutf-8%26oe%3Dutf-8%26aq%3Dt # escape a string of lines of HTML code <?pl my $string = '<h1>You & Me</h1> <h2>Me & You</h2>'; ?> [== text2html($string) =] # returns &lt;h1&gt;You &amp; Me&lt;/h1&gt;<br /> &lt;h2&gt;Me &amp; You&lt;/h2&gt; DESCRIPTION
This module provides a few utility functions which can be used in your templates for your convenience. These include functions to (un)escape and (en/de)code URLs. METHODS
expand_tabs( $str, [$tabwidth] ) Receives a string that might contain tabs in it, and replaces those tabs with spaces, each tab with the number of spaces defined by $tabwidth, or, if $tabwidth was not passed, with 8 spaces. escape_xml( $str ) Receives a string of XML (or (x)HTML) code and converts the characters <>&' to HTML entities. This is the method that is invoked when you use [= $expression =] in your templates. unescape_xml( $str ) Receives a string of escaped XML (or (x)HTML) code (for example, a string that was escaped with the escape_xml() function, and 'unescapes' all HTML entities back to their actual characters. encode_url( $url ) Receives a URL and encodes it by escaping 'non-standard' characters. decode_url( $url ) Does the opposite of encode_url(). checked( $val ) Receives a value of some sort, and if it is a true value, returns the string ' checked="checked"' which can be appended to HTML checkboxes. selected( $val ) Receives a value of some sort, and if it is a true value, returns the string ' selected="selected"' which can be used in an option in an HTML select box. disabled( $val ) Receives a value of some sort, and if it is a true value, returns the string ' disabled="disabled"' which can be used in an HTML input. nl2br( $text ) Receives a string of text containing lines delimited by newline characters ( , or possibly ) and appends an HTML line break (<br />) to every line (the newline character is left untouched). text2html( $text ) Receives a string of text containing lines delimited by newline characters, and possibly some XML (or (x)HTML) code, escapes that code with escape_xml() and then appends an HTML line break to every line with nl2br(). tagattr( $name, $expr, [$value] ) tagattrs( %attrs ) new_cycle( @items ) Creates a subroutine reference that can be used for cycling through the items of the @items array. So, for example, you can: my $cycle = new_cycle(qw/red green blue/); print $cycle->(); # prints 'red' print $cycle->(); # prints 'green' print $cycle->(); # prints 'blue' print $cycle->(); # prints 'red' again INTERNAL(?) METHODS _p( $expression ) Wraps a Perl expression in a customized wrapper which will be processed by the Tenjin preprocessor and replaced with the standard [== $expression =]. _P( $expression ) Wrap a Perl expression in a customized wrapper which will be processed by the Tenjin preprocessor and replaced with the standard [= $expression =], which means the expression will be escaped. _decode_params( $s ) SEE ALSO
Tenjin, Tenjin::Template, Tenjin::Context. AUTHOR
The CPAN version of Tenjin was forked by Ido Perlmuter <ido at ido50.net> from version 0.0.2 of the original plTenjin, which is developed by Makoto Kuwata at http://www.kuwata-lab.com/tenjin/ <http://www.kuwata-lab.com/tenjin/>. Development of Tenjin is done with github at <http://github.com/ido50/Tenjin>. LICENSE AND COPYRIGHT
Tenjin is licensed under the MIT license. Copyright (c) 2007-2010 the aforementioned authors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. perl v5.12.4 2011-03-29 Tenjin::Util(3pm)
All times are GMT -4. The time now is 08:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy