01-13-2011
Yes...found a way.
open (STDOUT, "| tee -ai log.txt");
print "blah blah";
close (STDOUT);
This works perfectly. Thanks ghostdog74
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 CENTOS
bf_tar
BF_TAR(1) Bogofilter Reference Manual BF_TAR(1)
NAME
bf_tar - shell script to write a tar file of a bogofilter directory to stdout
SYNOPSIS
bf_tar [-r] [-R] bogofilter_directory
DESCRIPTION
bf_tar bundles a bogofilter working directory in tar format and copies it to standard output (your console, or where you redirect it, see
EXAMPLES below).
OPTIONS
The -r option causes bf_tar to remove inactive log files after the archive has been written successfully. The default is to leave log
files.
The -R option causes bf_tar to remove inactive log files before the archive is written. This may reduce chances that the resulting archive
is recoverable should it become damaged. The archive may be smaller though. The default is to leave log files.
EXIT STATUS
The script exits with status code 0 if everything went well, and nonzero if it encountered trouble.
EXAMPLES
o bf_tar ~/.bogofilter > outfile.tar
Writes a standard .tar file containing the essential files from ~/.bogofilter to outfile.tar.
o bf_tar ~/.bogofilter | gzip -9 -c > outfile.tar.gz
Writes a gzipped .tar.gz file containing the essential files from ~/.bogofilter to outfile.tar.gz.
o bf_tar `pwd`/mydirectory > outfile.tar
Prepend $(pwd)/ or `pwd`/ if you want to specify an absolute path instead of a relative path.
NOTES
This script is meant for use with Berkeley DB based bogofilter versions.
This script requires a SUSv2 compliant pax utility.
This script expects a SUSv2 compliant shell. Solaris systems should have the SUNWxcu4 package installed (when bogofilter is configured) so
that /usr/xpg4/bin/sh can be used.
AUTHORS
Matthias Andree
Bogofilter 10/22/2012 BF_TAR(1)