01-07-2009
Um, you have to provide a filename or redirect the file into it. Also, I had forgotten an apostrophe. I corrected the post. Try it now.
Last edited by otheus; 01-07-2009 at 11:51 AM..
Reason: update after solution
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
How can convert a Lower case variable value to an upper case in the kron shell script. (3 Replies)
Discussion started by: dchalavadi
3 Replies
2. UNIX for Advanced & Expert Users
I need a shell script which will convert the given string to Title case.
E.g "hi man"
to "Hi man" (5 Replies)
Discussion started by: SankarV
5 Replies
3. Shell Programming and Scripting
perl script:
my $logdir = '/smp/dyn/logfiles/fsm/mp/mp';
$logdir = $logdir ."/mp${toDate}*";
i tried to make it..as below .. but not working ..
date +%m%d%y
logdir = /smp/dyn/logfiles/fsm/mp/mp
logdir=$logdir/mp"$date"
but it was not working.....
can someone please help me out in... (1 Reply)
Discussion started by: mail2sant
1 Replies
4. Shell Programming and Scripting
Hi all experts,
I am new to Unix. Could you please help me to convert the following PERL script to SHELL? I will appreciate.
#!/bin/sh
use strict;
use warnings;
my $robot_num = 0;
my %rob_tapes;
foreach (`/usr/openv/volmgr/bin/vmquery -l -rn $robot_num`)
{ $rob_tapes{(split)} = 1; }... (6 Replies)
Discussion started by: ma466
6 Replies
5. Shell Programming and Scripting
Hi All
I have a script which extracts values from a Database (A persons name) and puts it into a variable in my script IE: $NAME
However the Value in the DB is all in uppercase and contains the users first name and last name
EG:
> echo $NAME
GRAHAM BOYLE
>
What I need is only the... (7 Replies)
Discussion started by: grahambo2005
7 Replies
6. Shell Programming and Scripting
This is about how to Monitoring folder for new files using shell script
im doing a project using smsserver tools 3. i have used a perl script
to handle incoming messages. the content of each message must be
directed to a java program. this program generates the answer to reply
to the user... (2 Replies)
Discussion started by: x34
2 Replies
7. Shell Programming and Scripting
bash$ mdb-schema x.mdb | perl -wpe 's%^DROP TABLE %DROP TABLE IF EXISTS %i;
s%(Memo/Hyperlink|DateTime( \(Short\))?)%TEXT%i;
s%(Boolean|Byte|Byte|Numeric|Replication ID|(\w+ )?Integer)%INTEGER%i;
s%(BINARY|OLE|Unknown (+)?)%BLOB%i;
s%\s*\(\d+\)\s*(,?*)$%${1}%;' | sqlite3 x.db
... (1 Reply)
Discussion started by: jackpapa
1 Replies
8. Shell Programming and Scripting
Hi all,
Not sure if this should be in the programming forum, but I believe it will get more response under the Shell Programming and Scripting FORUM.
Am trying to write a customized df script in Perl and need some help with regards to using arrays and file handlers.
At the moment am... (3 Replies)
Discussion started by: newbie_01
3 Replies
9. Shell Programming and Scripting
Hello,,I have a very small script that contains these lines; and it works perfectly; however I need to use Perl now as I will need to feel variables from a MySQL table into this; to it would be nice to start by converting this first...
find / -perm 777 \( -type f -o -type d \) -exec ls -lid {}... (1 Reply)
Discussion started by: gvolpini
1 Replies
10. UNIX for Advanced & Expert Users
Hi :)
I have a .txt file with thousands of words.
I was wondering if i could use a simple sed or awk command to convert / replace all words in the text file to Title Case format ?
Example:
from:
this is line one
this is line two
this is line three
to desired output:
This Is Line... (8 Replies)
Discussion started by: martinsmith
8 Replies
LEARN ABOUT DEBIAN
poe::component::irc::plugin::followtail
POE::Component::IRC::Plugin::FollowTail(3pm) User Contributed Perl Documentation POE::Component::IRC::Plugin::FollowTail(3pm)
NAME
POE::Component::IRC::Plugin::FollowTail - A PoCo-IRC plugin to follow the tail of an ever-growing file
SYNOPSIS
use POE qw(Component::IRC Component::IRC::Plugin::FollowTail);
my $nickname = 'Flibble' . $$;
my $ircname = 'Flibble the Sailor Bot';
my $ircserver = 'irc.blahblahblah.irc';
my $filename = '/some/such/file/here';
my @channels = ( '#Blah', '#Foo', '#Bar' );
my $irc = POE::Component::IRC->spawn(
nick => $nickname,
server => $ircserver,
port => $port,
ircname => $ircname,
) or die "Oh noooo! $!";
POE::Session->create(
package_states => [
main => [ qw(_start irc_001 irc_tail_input irc_tail_error irc_tail_reset) ],
],
);
$poe_kernel->run();
sub _start {
$irc->plugin_add( 'FollowTail' => POE::Component::IRC::Plugin::FollowTail->new(
filename => $filename,
));
$irc->yield( register => 'all' );
$irc->yield( connect => { } );
return;
}
sub irc_001 {
$irc->yield( join => $_ ) for @channels;
return;
}
sub irc_tail_input {
my ($kernel, $sender, $filename, $input) = @_[KERNEL, SENDER, ARG0, ARG1];
$kernel->post( $sender, 'privmsg', $_, "$filename: $input" ) for @channels;
return;
}
sub irc_tail_error {
my ($kernel, $sender, $filename, $errnum, $errstring)
= @_[KERNEL, SENDER, ARG0 .. ARG2];
$kernel->post( $sender, 'privmsg', $_, "$filename: ERROR: $errnum $errstring" ) for @channels;
$irc->plugin_del( 'FollowTail' );
return;
}
sub irc_tail_reset {
my ($kernel, $sender, $filename) = @_[KERNEL, SENDER, ARG0];
$kernel->post( $sender, 'privmsg', $_, "$filename: RESET EVENT" ) for @channels;
return;
}
DESCRIPTION
POE::Component::IRC::Plugin::FollowTail is a POE::Component::IRC plugin that uses POE::Wheel::FollowTail to follow the end of an ever-
growing file. It generates "irc_tail_" prefixed events for each new record that is appended to its file.
METHODS
"new"
Takes two arguments:
'filename', the name of the file to tail, mandatory;
'filter', a POE::Filter object to pass to POE::Wheel::FollowTail, optional;
Returns a plugin object suitable for feeding to POE::Component::IRC's "plugin_add" method.
OUTPUT EVENTS
The plugin generates the following additional POE::Component::IRC events:
"irc_tail_input"
Emitted for every complete record read. "ARG0" will be the filename, "ARG1" the record which was read.
"irc_tail_error"
Emitted whenever an error occurs. "ARG0" will be the filename, "ARG1" and "ARG2" hold numeric and string values for $!, respectively.
"irc_tail_reset"
Emitted every time a file is reset. "ARG0" will be the filename.
AUTHOR
Chris 'BinGOs' Williams
SEE ALSO
POE::Component::IRC
POE::Wheel::FollowTail
perl v5.14.2 2011-12-07 POE::Component::IRC::Plugin::FollowTail(3pm)