01-13-2011
Perl :How to print the o/p of a Perl script on console and redirecting same in log file @ same time.
How can i print the output of a perl script on a unix console and redirect the same in a log file under same directory simultaneously ?
Like in Shell script, we use tee, is there anything in Perl or any other option ?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
as the title suggests, i need to print a user message to a log file and the screen using perl.
in unix i set up a function using 'tee' like so
function Display_Message
{
echo "$*" | tee -ai $LOGFILE
}
the following command then obviously displays to the screen and prints to a log... (6 Replies)
Discussion started by: mjays
6 Replies
2. Shell Programming and Scripting
Hello,
I have a Apache webserver running on RedHat. Its primary function is a proxy server for users accessing the internet. I have a transaction log that logs every transactions of every users. For users trying to access certain sites/content the transactions goes into a 302 redirect loop and... (2 Replies)
Discussion started by: bruno406
2 Replies
3. Shell Programming and Scripting
Can someone tell me what I'm doing wrong with my perl script? I am new to Perl. This isn't even the final script, I'm just testing to see if it will print the directories with the files in it. For some reason my output is only printing the 1st, 6th, and last entries of the @sub_dir array. Each... (3 Replies)
Discussion started by: man
3 Replies
4. Shell Programming and Scripting
Hi Perl Gurus,
perl -e 'print "http://www.site@domain.com"'
The output of the above is :
http://www.site.com"
I want to print http://www.site@domain.com without using escape sequence before '@' like '\@'.
Is there any way to do this in perl?
Thanks,
Som (1 Reply)
Discussion started by: som.nitk
1 Replies
5. Shell Programming and Scripting
Hi All,
Is there a way in Bash we can redirection some output to both console and the file at the same time.
~Parag (2 Replies)
Discussion started by: paragkalra
2 Replies
6. Shell Programming and Scripting
Hi
I have a perl script that prints all the video and audio file information(playing duration).
It works fine in one of my friends linux laptop.
But it doesn't work in my both windows and linux.
My friend told me I have to do install some module ( ppm instal ...... )
but I have no... (1 Reply)
Discussion started by: srijith
1 Replies
7. Web Development
Can anyone tell me how to export a variable from one perl CGI script to another perl cgi script when using a redirect.
Upon running the login.pl the user is prompted to enter user name and password. Upon entering the correct credentials (admin/admin) the user is
redirected to welcome page.
My... (3 Replies)
Discussion started by: Arun_Linux
3 Replies
8. Shell Programming and Scripting
I do a lot of TSM work and I embarked on what I thought would be an easy task, and I'd be very happy for any input to save the pounding my keyboard is receiving :]
By default, the output of TSM's console has no timestamping, making it hard to sort through accurately.
This puts my console into... (5 Replies)
Discussion started by: Vryali
5 Replies
9. Shell Programming and Scripting
Hi,
I am preparing a perl script, which will run some commads on remote Linux servers.
I have a file contains all the servers names one by one like below
vi servers.txt
srv1
srv2
srv3
Now, I need to prepare a perl script to ssh (or)rsh to each server in the above... (1 Reply)
Discussion started by: kumar85shiv
1 Replies
10. Programming
I have reviewed many examples on-line about running another process (either PERL or shell command or a program), but do not find any usefull for my needs way. (Reviewed and not useful the system(), 'back ticks', exec() and open())
I would like to run another PERL-script from first one, not... (1 Reply)
Discussion started by: alex_5161
1 Replies
LEARN ABOUT OSX
cpanplus::shell::default::plugins::source
CPANPLUS::Shell::Default::Plugins::Source(3pm) Perl Programmers Reference Guide CPANPLUS::Shell::Default::Plugins::Source(3pm)
NAME
CPANPLUS::Shell::Default::Plugins::Source - read in CPANPLUS commands
SYNOPSIS
CPAN Terminal> /source /tmp/list_of_commands /tmp/more_commands
DESCRIPTION
This is a "CPANPLUS::Shell::Default" plugin that works just like your unix shells source(1) command; it reads in a file that has commands
in it to execute, and then executes them.
A sample file might look like this:
# first, update all the source files
x --update_source
# find all of my modules that are on the CPAN
# test them, and store the error log
a ^KANE$'
t *
p /home/kane/cpan-autotest/log
# and inform us we're good to go
! print "Autotest complete, log stored; please enter your commands!"
Note how empty lines, and lines starting with a '#' are being skipped in the execution.
BUG REPORTS
Please report bugs or other issues to <bug-cpanplus@rt.cpan.org<gt>.
AUTHOR
This module by Jos Boumans <kane@cpan.org>.
COPYRIGHT
The CPAN++ interface (of which this module is a part of) is copyright (c) 2001 - 2007, Jos Boumans <kane@cpan.org>. All rights reserved.
This library is free software; you may redistribute and/or modify it under the same terms as Perl itself.
SEE ALSO
CPANPLUS::Shell::Default, CPANPLUS::Shell, cpanp
perl v5.16.2 2012-10-11 CPANPLUS::Shell::Default::Plugins::Source(3pm)