Sponsored Content
Top Forums Shell Programming and Scripting perl: howto print to screen & filehandle Post 302221402 by Ikon on Monday 4th of August 2008 11:32:29 AM
Old 08-04-2008
Is this what you mean?

Code:
$messages = "This is some message!!\n";
$messages .= "Another message!!\n";

$filename = "/some/dir/file.log";

open (FILE, "< $filename" ) or print " Error \n";
 print FILE $message;    #Sends message to {$filename}
 print $message;         #Sends message to Screen
close FILE;

Would write:
This is some message!!
Another message!!

To file and screen.
 

10 More Discussions You Might Find Interesting

1. Programming

Howto convert Ascii -> UTF-8 & back C++

While working with russian text under FreeBSD&MySQL I need to convert a string from MySQL to the Unicode format. I've just started my way in C++ under FreeBSD , so please explain me how can I get ascii code of Char variable and also how can i get a character into variable with the specified ascii... (3 Replies)
Discussion started by: macron
3 Replies

2. Shell Programming and Scripting

perl - print to a log file and screen

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

3. AIX

print screen

Hi all, Could you please tell me how to take a screenshot in aix (like Print Screen button in windows)? Thanks (7 Replies)
Discussion started by: prashantchavan
7 Replies

4. Shell Programming and Scripting

Perl: Opening a filehandle but not getting anything back from it

I have two perl functions defined, both run a set of shell commands on some somplied data and return hashs of the resulting parsed output from these shell commands. One works, one doesn't and I can't seem to see why. It's driving me insane :mad: The working one: sub getcellstatus { ... (8 Replies)
Discussion started by: Smiling Dragon
8 Replies

5. Solaris

Howto troubleshoot Perfomance using vmstat & iostat

Can anyone tell me what to look for in terms of abnormal numbers on vmstat or iostat? I have a box with figures pbelow, how would I tell if it's underperforming & what remedies \ perfomance tuning could I perform? thanks all ------------------------------------- -vmstat 5 5 kthr ... (4 Replies)
Discussion started by: stevie_velvet
4 Replies

6. Shell Programming and Scripting

Howto Print File Path or Print the Filename

I'm trying to clean up my samba share and need to print the found file or print the path of the image it tried to searched for. So far I have this but can't seem to get the logic right. Can anyone help point me in the right direction? for FILE in `cat list`; do if ; then ... (1 Reply)
Discussion started by: overkill
1 Replies

7. Shell Programming and Scripting

awk print: howto single quote not interpreted!?

cat a | awk -F";" '{print "update db set column=' "$2" ' where column1=\""$1"\";"}' > ip-add.sql Hi! I'm a new user! i need to use single quote in the double quotes print string The apex between che "$2" should not be interpreted, but....how?! I'm trying to use \ but don't work correctly! ... (4 Replies)
Discussion started by: Re DeL SiLeNziO
4 Replies

8. Shell Programming and Scripting

How to call a shell script from a perl module which uses Filehandle to login

Hi Guru's, Pardon me for the breach of rules..... I have very little knowledge about Shell Programming and Scripting hope you guys help me out of this troble I have very little time hence could not find the right way to direct my queries. coming to the problem I need to call a... (2 Replies)
Discussion started by: saikrishna_tung
2 Replies

9. Programming

Error:readline() on closed filehandle Perl

Hi, i have run the below perl code and i am getting an error Error:readline() on closed filehandle OR at run.pl line 31. CODE: =========================================== open OR,$ARGV; while (<OR>) { # find the batch date next if length $_ < 3; # BLANK LINE # last if $. > 120; #... (3 Replies)
Discussion started by: pspriyanka
3 Replies

10. Shell Programming and Scripting

perl FileHandle Closure during after unlock

Hi we have one function which is used to append data the file in exclusive lock mode in aperl script. This script is executed by multiple threads at the same time. accessing the same file.this script runs throught the day. sometimes the file2.txt size is getting reduced. for eg from 10 M... (1 Reply)
Discussion started by: Shahul
1 Replies
MLLP_SEND(1)							    python-hl7							      MLLP_SEND(1)

NAME
mllp_send - MLLP network client python-hl7 features a simple network client, mllp_send, which reads HL7 messages from a file or sys.stdin and posts them to an MLLP server. mllp_send is a command-line wrapper around hl7.client.MLLPClient. mllp_send is a useful tool for testing HL7 interfaces or resending logged messages: $ mllp_send --file sample.hl7 --port 6661 mirth.example.com MSH|^~&|LIS|Example|Hospital|Mirth|20111207105244||ACK^A01|A234244|P|2.3.1| MSA|AA|234242|Message Received Successfully| USAGE
Usage: mllp_send [options] <server> Options: -h, --help show this help message and exit -p PORT, --port=PORT port to connect to -f FILE, --file=FILE read from FILE instead of stdin -q, --quiet do not print status messages to stdout --loose allow file to be a HL7-like object ( instead of ). Can ONLY send 1 message. Requires --file option (no stdin) INPUT FORMAT
By default, mllp_send expects the FILE or stdin input to be a properly formatted HL7 message (carriage returns separating segments) wrapped in a MLLP stream (<SB>message1<EB><CR><SB>message2<EB><CR>...). However, it is common, especially if the file has been manually edited in certain text editors, that the ASCII control characters will be lost and the carriage returns will be replaced with the platform's default line endings. In this case, mllp_send provides the --loose option, which attempts to take something that "looks like HL7" and convert it into a proper HL7 message. Currently the --loose option can only handle 1 HL7 message per file (it causes mllp_send to assume the whole file is one HL7 message). ADDITIONAL RESOURCES
o http://python-hl7.readthedocs.org AUTHOR
John Paulett COPYRIGHT
2011, John Paulett 0.2.2 December 17, 2011 MLLP_SEND(1)
All times are GMT -4. The time now is 10:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy