I have a script that is run from the Cron 3 times an hour, here is the cron line:
02,22,42 7-18 * * 1-5 /hci/TEST/bin/myscript.ksh TEST 1>/hci/TEST/logs/myscript.info 2>/hci/TEST/logs/myscript
I am curious as to whether the time parameters from cron, ( 02, 22, 42 etc) can be accessed from the... (2 Replies)
I've done this before but I can't remember how. Too long away from vi.
I want to do a search are replace, but I want the replace to be a join.
Example
see spot run
see spot walk
see spot run fast
see spot hop
%s/run$/<somehow perform a join with the next line>/g
so the results... (0 Replies)
hi,
i have a file with folowing content:
STORAGE PERCENTAGE FLAG:
/storage_01 64% 0
/storage_02 17% 1
/storage_03 10% 0
/storage_04 50% 1
I need to get the value of STORAGE from those with FLAG=0 and which has the min PERCENTAGE
i am able to get the STORAGE corresponding to... (8 Replies)
Hi! I'm trying to take multiple text files (6), which have text on some lines but not others, and combine them. I'd also like to make the values in one column of some of the files (files 4-6) negative. I'm trying to write a short script (see below) as I have to do this with a large number of... (2 Replies)
Hi,
How to replace only the function calls with a new name and skip the function definition and declarations. consider the following code.
There are 2 functions defined here returnint and returnvoid.
I need to replace returnint with giveint and returnvoid with givevoid only in the function... (1 Reply)
Hi,
How to replace only the function calls with a new name and skip the function definition and declarations. consider the following code.
There are 2 functions defined here returnint and returnvoid.
I need to replace returnint with giveint and returnvoid with givevoid only in the function... (2 Replies)
Hi Friends,
Newbie to shell scripting. Currently i have used the below to sort data based on filenames and datestamp
$ printf '%s\n' *.dat* | sort -t. -k3,4
filename_1.dat.20120430.Z
filename_2.dat.20120430.Z
filename_3.dat.20120430.Z
filename_1.dat.20120501.Z
filename_2.dat.20120501.Z... (1 Reply)
Hi Friends,
Newbie to shell scripting
Currently i have used the below to sort data based on filenames and datestamp
$ printf '%s\n' *.dat* | sort -t. -k3,4
filename_1.dat.20120430.Z
filename_2.dat.20120430.Z
filename_3.dat.20120430.Z
filename_1.dat.20120501.Z
filename_2.dat.20120501.Z... (12 Replies)
Hi
I need to transfer files with csv extension from one server to another (all running solaris).
But the files to be picked are in a directory that also has:
/directory
deposit_698.csv
deposit_698.checksum
deposit_699.csv
deposit_699.checksum
deposit_700.csv
deposit_700.checksum... (15 Replies)
Discussion started by: fretagi
15 Replies
LEARN ABOUT DEBIAN
mojo
Mojo(3pm) User Contributed Perl Documentation Mojo(3pm)NAME
Mojo - Duct tape for the HTML5 web!
SYNOPSIS
use Mojo::Base 'Mojo';
# All the complexities of CGI, PSGI, HTTP and WebSockets get reduced to a
# single method call!
sub handler {
my ($self, $tx) = @_;
# Request
my $method = $tx->req->method;
my $path = $tx->req->url->path;
# Response
$tx->res->code(200);
$tx->res->headers->content_type('text/plain');
$tx->res->body("$method request for $path!");
# Resume transaction
$tx->resume;
}
DESCRIPTION
Mojo provides a flexible runtime environment for Perl real-time web frameworks. It provides all the basic tools and helpers needed to write
simple web applications and higher level web frameworks such as Mojolicious.
See Mojolicious for more!
ATTRIBUTES
Mojo implements the following attributes.
"home"
my $home = $app->home;
$app = $app->home(Mojo::Home->new);
The home directory of your application, defaults to a Mojo::Home object which stringifies to the actual path.
# Generate portable path relative to home directory
my $path = $app->home->rel_file('data/important.txt');
"log"
my $log = $app->log;
$app = $app->log(Mojo::Log->new);
The logging layer of your application, defaults to a Mojo::Log object.
# Log debug message
$app->log->debug('It works!');
"ua"
my $ua = $app->ua;
$app = $app->ua(Mojo::UserAgent->new);
A full featured HTTP 1.1 user agent for use in your applications, defaults to a Mojo::UserAgent object. Note that this user agent should
not be used in plugins, since non-blocking requests that are already in progress will interfere with new blocking ones.
# Perform blocking request
my $body = $app->ua->get('mojolicio.us')->res->body;
METHODS
Mojo inherits all methods from Mojo::Base and implements the following new ones.
"new"
my $app = Mojo->new;
Construct a new Mojo application. Will automatically detect your home directory and set up logging to "log/mojo.log" if there's a "log"
directory.
"build_tx"
my $tx = $app->build_tx;
Transaction builder, defaults to building a Mojo::Transaction::HTTP object.
"config"
my $config = $app->config;
my $foo = $app->config('foo');
$app = $app->config({foo => 'bar'});
$app = $app->config(foo => 'bar');
Application configuration.
# Manipulate configuration
$app->config->{foo} = 'bar';
my $foo = $app->config->{foo};
delete $app->config->{foo};
"handler"
$app->handler($tx);
The handler is the main entry point to your application or framework and will be called for each new transaction, which will usually be a
Mojo::Transaction::HTTP or Mojo::Transaction::WebSocket object. Meant to be overloaded in a subclass.
sub handler {
my ($self, $tx) = @_;
...
}
SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.
perl v5.14.2 2012-09-05 Mojo(3pm)