01-09-2004
Shell Coding question for any experts out there
Given this one long stream of data (all one line):
<TransactionDetail><TransactionHeader><ErrorLogging>YES</ErrorLogging><HistoryLogging>YES</HistoryLogging><ErrorDetection>NO</ErrorD
etection.0</LunKey><WorkingDir>/tlexmlt/xlate/i/10397</WorkingDir><JobName>I10397</JobName><ErrorCode>0</ErrorCode><ErrorMessage>EDI InboundRejects</ErrorMessage><GetNext>Y</GetNext><WorkStep>Xlati</WorkStep</ReplyItem></TransactionDetail>
How do I get this small piece of information back?
/tlexmlt/xlate/i/10397
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
SunOS5.8 is a radical departure from SunOs4.X in many ways. one of the important differences is the handling of devices. Adding devices under SunOS4.x required a kernel reconfiguration, recompliation and reboot. Under SunOS5.X, this has changed with the ability to add some drivers on the fly.... (1 Reply)
Discussion started by: Foo49272
1 Replies
2. Shell Programming and Scripting
Is there any site on Coding Standard for Shell Scripting in UNIX.
Please help me know!!!!!
Thanks
Om (1 Reply)
Discussion started by: Omkumar
1 Replies
3. Shell Programming and Scripting
I need a little help with sed. Basically, I need to parse out selections from the output of hddtemp so conky can display some hdd temps for me. I have hddtemp in daemon mode so A simple 'nc localhost 7634' displays the following:
$ nc localhost 7634... (3 Replies)
Discussion started by: audiophile
3 Replies
4. Shell Programming and Scripting
Hi,
Can anyone point me to Secure coding standards for shell programming guides, links etc etc...
Thanks and regards,
Vamsi K Surampalli. (2 Replies)
Discussion started by: vamsisurampalli
2 Replies
5. Shell Programming and Scripting
Hi guys
I am trying to perform a substitution using 'awk' command, but it fails.
I work in ksh. Here is my code:
$ line="F 18:30 10 23:00 ts1632back"
$ n="ts1632back"
$ m="18:45"
$ echo ${line} | nawk -v a=$n -v b=$m '{if ($5==a) $2=m; print }'
F 10 23:00 ts1632back
$It should've... (2 Replies)
Discussion started by: aoussenko
2 Replies
6. Shell Programming and Scripting
I have seen the old forums before posting this thread...I did not find the designated answer for my shell script... I am novice in shell programming:
Can some one help on how i can loop with in the loop when comparing two files...
I need to compare ID in File1 with IDs in File2...If the ID... (1 Reply)
Discussion started by: rspotula
1 Replies
7. UNIX for Advanced & Expert Users
Hi experts,
Please help me on the below:
how to write a shell script to search and delete files on windows server.
-script runs on unix box
-it should search for specific files on windows server and delete them periodically. (1 Reply)
Discussion started by: chpradeepch
1 Replies
8. Shell Programming and Scripting
I have a file f1.txt that contains string:
f1.txt
aaa
bbb
ccc
...
I want to write code to search that each string in file f2.txt(this file contains 1000+line codes).
file f2.txt
..
..
....aaa...xyz..
...
...
...ppp...
(dots . can be characters ot blank spaces)
If particular... (2 Replies)
Discussion started by: Sanchit
2 Replies
9. Homework & Coursework Questions
i am trying to write a script code in unix that will:
1. The problem statement, all variables and given/known data:
display following menu to user:
(A) Add
(B) Subtract
(C) Multiply
(D) Divide
(E) Modulus
(F) Exponentiation
(G) Exit
Then ask user for choice (A-F). After taking... (5 Replies)
Discussion started by: renegade755
5 Replies
10. UNIX for Dummies Questions & Answers
Good afternoon everyone,
I am very new to UNIX shell scripting and I am trying to understand the following code. I know what it does but I need to modify it so it will allow me to pass a file name as *FILENAME*
Thank for any guidance offered.
if ] ; then
match=`expr "$file" :... (2 Replies)
Discussion started by: Walter Barona
2 Replies
LEARN ABOUT DEBIAN
mojo::ioloop::stream
Mojo::IOLoop::Stream(3pm) User Contributed Perl Documentation Mojo::IOLoop::Stream(3pm)
NAME
Mojo::IOLoop::Stream - Non-blocking I/O stream
SYNOPSIS
use Mojo::IOLoop::Stream;
# Create stream
my $stream = Mojo::IOLoop::Stream->new($handle);
$stream->on(read => sub {
my ($stream, $chunk) = @_;
...
});
$stream->on(close => sub {
my $stream = shift;
...
});
$stream->on(error => sub {
my ($stream, $err) = @_;
...
});
# Start and stop watching for new data
$stream->start;
$stream->stop;
DESCRIPTION
Mojo::IOLoop::Stream is a container for I/O streams used by Mojo::IOLoop.
EVENTS
Mojo::IOLoop::Stream can emit the following events.
"close"
$stream->on(close => sub {
my $stream = shift;
...
});
Emitted safely if the stream gets closed.
"drain"
$stream->on(drain => sub {
my $stream = shift;
...
});
Emitted safely once all data has been written.
"error"
$stream->on(error => sub {
my ($stream, $err) = @_;
...
});
Emitted safely if an error happens on the stream.
"read"
$stream->on(read => sub {
my ($stream, $chunk) = @_;
...
});
Emitted safely if new data arrives on the stream.
"timeout"
$stream->on(timeout => sub {
my $stream = shift;
...
});
Emitted safely if the stream has been inactive for too long and will get closed automatically.
"write"
$stream->on(write => sub {
my ($stream, $chunk) = @_;
...
});
Emitted safely if new data has been written to the stream.
ATTRIBUTES
Mojo::IOLoop::Stream implements the following attributes.
"reactor"
my $reactor = $stream->reactor;
$stream = $stream->reactor(Mojo::Reactor::Poll->new);
Low level event reactor, defaults to the "reactor" attribute value of the global Mojo::IOLoop singleton.
"timeout"
my $timeout = $stream->timeout;
$stream = $stream->timeout(45);
Maximum amount of time in seconds stream can be inactive before getting closed automatically, defaults to 15. Setting the value to 0 will
allow this stream to be inactive indefinitely.
METHODS
Mojo::IOLoop::Stream inherits all methods from Mojo::EventEmitter and implements the following new ones.
"new"
my $stream = Mojo::IOLoop::Stream->new($handle);
Construct a new Mojo::IOLoop::Stream object.
"close"
$stream->close;
Close stream immediately.
"handle"
my $handle = $stream->handle;
Get handle for stream.
"is_readable"
my $success = $stream->is_readable;
Quick non-blocking check if stream is readable, useful for identifying tainted sockets.
"is_writing"
my $success = $stream->is_writing;
Check if stream is writing.
"start"
$stream->start;
Start watching for new data on the stream.
"stop"
$stream->stop;
Stop watching for new data on the stream.
"steal_handle"
my $handle = $stream->steal_handle;
Steal handle from stream and prevent it from getting closed automatically.
"write"
$stream->write('Hello!');
$stream->write('Hello!', sub {...});
Write data to stream, the optional drain callback will be invoked once all data has been written.
SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.
perl v5.14.2 2012-09-05 Mojo::IOLoop::Stream(3pm)