The script bartus11 provided works perfectly with your sample input and should work reliably as long as your input file never has two or more adjacent missing lines. But, with the input:
it will produce:
If this is an issue with the input you expect to process, the script:
produces:
If you want to try this on a Solaris/SunOS system change awk in the above script to nawk like bartus11 did or to /usr/xpg4/bin/awk or /usr/xpg6/bin/awk.
Hello
I am new to Perl, in fact I am on chapter one of the book. :) However I am in need of a Perl Script faster than I can finish the book. Perhaps someone can help me with my immediate need while I read my book.
I have a directory with hundreds of files that are all named like... (4 Replies)
Hi,
My requirement is I have an input file with a continuous series from 10000 to 99999. I have some numbers missing from those series. I want a output file which produces those missing numbers.
Eg: 10002, 99999 are missing from the series then the output file should contain those... (4 Replies)
I have a file that contains 87 lines, each with a set of coordinates (x & y). This file looks like:
1 200.3 -0.3
2 201.7 -0.32
...
87 200.2 -0.314
I have another file which contains data that was taken at certain of these 87 positions. i.e.:
37 125
42 175
86 142
where the first... (1 Reply)
Hi,
I have one input file with the following content:
MY_inpfile.txt
Aname1 Cname1 Cname2 1808 5
Aname2 Cname1 1802 47
Bname1 ? 1819 22
Bname2 Cname1 1784 11
Bname3 1817 9
Zname1 Cname1 1805 59
Zname2 Cname1 Cname2 Cname3 1797 27
Every line in my input file have a 4 digit... (5 Replies)
Dear Perl users,
I need your help to solve my problem below.
I want to print the sequence number without missing number within the range.
E.g. my sequence number :
1 2 3 4 5 6 7 8 11 12 13 14
my desired output:
1 -8 , 11-14
my code below but still problem with the result:
1 - 14
1 -... (2 Replies)
Ok, Lets see if I can explain this
We have a script that pulls information from multiple files and outputs it, however I only need 2 Columns (of 11) from it
right now I run the script like this:
tkxtrn | awk '{print $5" "" "$9}'
This gives me column 5 and 9, the only two I care for
... (5 Replies)
Am using unix aix KSH...
I have the files called
MMRR0106.DAT
MMRR0206.DAT
MMRR0406.DAT
MMRR0506.DAT
MMRR0806.DAT
....
...
MMRR3006.DAT
MMRR0207.DAT
These files are in one dircetory /venky ?
I want the output like this ?
Missing files are :
MMRR0306.DAT
MMRR0606.DAT... (7 Replies)
I am developing a script. This script takes in one parameter which is the name of a file whose content is a list of names of some files. The script can check whether those files exist in current directory.
Here is my question:
If the number of provided parameters is less than one or one of the... (2 Replies)
Hi All,
I have a requirement that i need to list only the missing sequences with a unix script.
For Example:
Input:
FILE_001.txt
FILE_002.txt
FILE_005.txt
FILE_006.txt
FILE_008.txt
FILE_009.txt
FILE_010.txt
FILE_014.txt
Output:
FILE_003.txt
FILE_004.txt
FILE_007.txt
FILE_011.txt... (5 Replies)
Discussion started by: Arun1992
5 Replies
LEARN ABOUT DEBIAN
mojo::server::daemon
Mojo::Server::Daemon(3pm) User Contributed Perl Documentation Mojo::Server::Daemon(3pm)NAME
Mojo::Server::Daemon - Non-blocking I/O HTTP 1.1 and WebSocket server
SYNOPSIS
use Mojo::Server::Daemon;
my $daemon = Mojo::Server::Daemon->new(listen => ['http://*:8080']);
$daemon->unsubscribe('request');
$daemon->on(request => sub {
my ($daemon, $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;
});
$daemon->run;
DESCRIPTION
Mojo::Server::Daemon is a full featured non-blocking I/O HTTP 1.1 and WebSocket server with "IPv6", "TLS" and "libev" support.
Optional modules EV, IO::Socket::INET6 and IO::Socket::SSL are supported transparently and used if installed. Individual features can also
be disabled with the "MOJO_NO_IPV6" and "MOJO_NO_TLS" environment variables.
See Mojolicious::Guides::Cookbook for more.
EVENTS
Mojo::Server::Daemon inherits all events from Mojo::Server.
ATTRIBUTES
Mojo::Server::Daemon inherits all attributes from Mojo::Server and implements the following new ones.
"backlog"
my $backlog = $daemon->backlog;
$daemon = $daemon->backlog(128);
Listen backlog size, defaults to "SOMAXCONN".
"group"
my $group = $daemon->group;
$daemon = $daemon->group('users');
Group for server process.
"inactivity_timeout"
my $timeout = $daemon->inactivity_timeout;
$daemon = $daemon->inactivity_timeout(5);
Maximum amount of time in seconds a connection can be inactive before getting closed, defaults to the value of the
"MOJO_INACTIVITY_TIMEOUT" environment variable or 15. Setting the value to 0 will allow connections to be inactive indefinitely.
"ioloop"
my $loop = $daemon->ioloop;
$daemon = $daemon->ioloop(Mojo::IOLoop->new);
Loop object to use for I/O operations, defaults to the global Mojo::IOLoop singleton.
"listen"
my $listen = $daemon->listen;
$daemon = $daemon->listen(['https://localhost:3000']);
List of one or more locations to listen on, defaults to the value of the "MOJO_LISTEN" environment variable or "http://*:3000".
# Listen on IPv6 interface
$daemon->listen(['http://[::1]:4000']);
# Listen on two ports with HTTP and HTTPS at the same time
$daemon->listen([qw(http://*:3000 https://*:4000)]);
# Use a custom certificate and key
$daemon->listen(['https://*:3000?cert=/x/server.crt&key=/y/server.key']);
# Or even a custom certificate authority
$daemon->listen(
['https://*:3000?cert=/x/server.crt&key=/y/server.key&ca=/z/ca.crt']);
These parameters are currently available:
"ca"
Path to TLS certificate authority file.
"cert"
Path to the TLS cert file, defaults to a built-in test certificate.
"key"
Path to the TLS key file, defaults to a built-in test key.
"max_clients"
my $max_clients = $daemon->max_clients;
$daemon = $daemon->max_clients(1000);
Maximum number of parallel client connections, defaults to 1000.
"max_requests"
my $max_requests = $daemon->max_requests;
$daemon = $daemon->max_requests(100);
Maximum number of keep alive requests per connection, defaults to 25.
"silent"
my $silent = $daemon->silent;
$daemon = $daemon->silent(1);
Disable console messages.
"user"
my $user = $daemon->user;
$daemon = $daemon->user('web');
User for the server process.
METHODS
Mojo::Server::Daemon inherits all methods from Mojo::Server and implements the following new ones.
"run"
$daemon->run;
Run server.
"setuidgid"
$daemon = $daemon->setuidgid;
Set user and group for process.
"start"
$daemon->start;
Start accepting connections.
DEBUGGING
You can set the "MOJO_DAEMON_DEBUG" environment variable to get some advanced diagnostics information printed to "STDERR".
MOJO_DAEMON_DEBUG=1
SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.
perl v5.14.2 2012-09-05 Mojo::Server::Daemon(3pm)