- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- perl script and tee failure
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2005 08:10 AM
тАО09-28-2005 08:10 AM
ftp module in it.
I am trying to use tee to get output from
perl script:
#!/bin/ksh
.
.
perlscript.pl | tee -a ./logfile.
The output does not go to logfile.
cron however does email me the perl output
I want. What's wrong with tee here?
The perl script is using the perl Net::FTP
module if that makes any difference.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2005 08:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2005 08:23 AM
тАО09-28-2005 08:23 AM
Re: perl script and tee failure
# script 2>&1 | tee logfile
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2005 08:30 AM
тАО09-28-2005 08:30 AM
Re: perl script and tee failure
YES! I (of course) do mean that!
# script 2>&1 | tee logfile
Thanks (and warm regards)!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2005 08:31 AM
тАО09-28-2005 08:31 AM
Re: perl script and tee failure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2005 09:21 AM
тАО09-28-2005 09:21 AM
Re: perl script and tee failure
I get stderr to console and logfile. ???
Why does Clays work okay.??
Here is the ksh script.
#!/bin/ksh
test.pl | tee -a a.out
Here is the perl code.
#!/usr/bin/perl
use strict;
use warnings;
use Net::FTP;
use Net::Netrc;
my $server="appsvr2";
my $file="testfile";
my $destination = "/tmp";
my $pageid = "sysadmins";
my $pager = "/usr/local/bin/pager";
my $ftpid = "user1";
my $pass = "pass12";
my $ftp = Net::FTP->new ($server, Timeout => 9000, Debug => 3) or die (exec "$pager $pageid \"$server: ftp AP cannot connect: $@\"") ;
$ftp->login("$ftpid","$pass") or die (exec "$pager $pageid \"ftp AP cannot login.\"") ;
$ftp->binary or die (exec "$pager $pageid \"ftp AP failed binary mode.\"") ;
#$ftp->cwd ($destination) or die (exec "$pager $pageid \"ftp AP failed cwd.\"") ;
$ftp->put ($file) or die (exec "$pager $pageid \"ftp AP cannot put file. \"") ;
$ftp->ls ($file) or die (exec "$pager $pageid \"ls of AP file failed. \"") ;
$ftp->quit;
# If we get this far then everything should be okay. Send notice to requestor.
my $uid=(stat ("testfile"))[4];
my $name=getpwuid ($uid);
open OU,"|mailx -s \"AP file sent\" $name";
open IN,"/tmp/runap.data";
print OU $_ while
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2005 10:46 AM
тАО09-28-2005 10:46 AM
Re: perl script and tee failure
I believe the difference is in the 'Debug' value you have specified. Non-zero values, cause all commands and responses to be sent to STDERR. Thus, 'cron' would take this output and email it to you, but your script (without the redirection I suggested) would not have routed its output to your logfile.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2005 01:25 PM
тАО09-28-2005 01:25 PM