05-06-2010
can you please provide a simple o/p format.. i mean how it should look
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I am new in shell scripting.
Can anyone point out what wrong of below script.
If I want the error output to "sqlerror.log"
and database pool data output to "bulk_main.dat".
Right now, the below script, if successful execute, the data will output to
bulk_main.dat && sqlerror.log both... (7 Replies)
Discussion started by: epall
7 Replies
2. UNIX for Dummies Questions & Answers
I have a program that is sending error text to the console and I need to redirect that output to a log file. I'm brand new to Unix and don't know how to do this. Any direction would be greatly appreciated. (1 Reply)
Discussion started by: ndemos
1 Replies
3. Shell Programming and Scripting
I'm writing a script using file descriptor 2 (std error) to send an email only if the command fails or errors out but the script always emails me irrepective of whether it fails or not. It will not email the /tmp/check.error file output if doesn't error out just the mail with the subject "Cannot... (3 Replies)
Discussion started by: barkath
3 Replies
4. Shell Programming and Scripting
Hi all,
Maybe my question is too simple but till now i couldn't figure about a solution :(
I have a bash script scheduled in cron:
<cron time parameters> my_script.sh > result.log 2>&1
By this way i can have standard output and standard error in my result.log file
Now i want my script... (2 Replies)
Discussion started by: Pescator
2 Replies
5. Programming
Hi,
I'm trying to compile the following code:
/************** Begin <test.c> ***************/
/*
* Compiled with: gcc -Wall -o test test.c
*/
#include <stdio.h>
#include <unistd.h>
int main(void)
{
printf("I'm process %d, son of %d \n", getpid(), getppid());
... (5 Replies)
Discussion started by: djodjo
5 Replies
6. Shell Programming and Scripting
Hi there
how can i get the result of a command to not give me its error. For example, on certain systems the 'zfs' command below is not available, but this is fine becaues I am testing against $? so i dont want to see the message " command not found" Ive tried outputting to /dev/null 2>&1 to no... (5 Replies)
Discussion started by: hcclnoodles
5 Replies
7. Shell Programming and Scripting
Hello,
I would like to know if there is a shell in which operations such as 2| (redirect standard error of one process to the standard input of another one) exist?
I know it is possible to do it in bash with things like:
(process 2>&1) | other_process
but I find it a bit intricate when... (3 Replies)
Discussion started by: chlorine
3 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I want to check a particular word is in standard error output or not. Can I acheive it in single command?
For example,
Delete file_name 2>error.log
cat error.log
Output:
XXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX
Successfully deleted
XXXXXXXXXXXXXXXXX
where delete is... (2 Replies)
Discussion started by: poova
2 Replies
9. Shell Programming and Scripting
Hi guys,
i have a script named purgeErrors.ksh, when i execute this script i need to redirect the output to a log file in the same directory, how can i do that ??
-- Aditya (5 Replies)
Discussion started by: chaditya
5 Replies
10. UNIX for Dummies Questions & Answers
Hello.
When I run a .ksh that contains the command below, and there is no file available in the source location the "FILE_NAME_*.CSV not found" error is still being displayed.
FILEN=$(ssh ${SOURCE_SERV} "cd ${SOURCE_LOCATION} ;ls ${FILES}") 2> /dev/null.
This is interfering with the rest... (4 Replies)
Discussion started by: jimbojames
4 Replies
LEARN ABOUT DEBIAN
graph::writer
Graph::Writer(3pm) User Contributed Perl Documentation Graph::Writer(3pm)
NAME
Graph::Writer - base class for Graph file format writers
SYNOPSIS
package Graph::Writer::MyFormat;
use Graph::Writer;
use vars qw(@ISA);
@ISA = qw(Graph::Writer);
sub _write_graph
{
my ($self, $graph, $FILE) = @_;
# write $graph to $FILE
}
DESCRIPTION
Graph::Writer is a base class for Graph file format writers. A particular subclass of Graph::Writer will handle a specific file format,
and generate a Graph, represented using Jarkko Hietaniemi's Graph class.
You should never create an instance of this class yourself, it is only meant for subclassing. If you try to create an instance of
Graph::Writer, the constructor will throw an exception.
METHODS
new()
Constructor - generate a new writer instance. This is a virtual method, or whatever the correct lingo is. You're not meant to call this on
the base class, it is inherited by the subclasses. Ie if you do something like:
$writer = Graph::Writer->new();
It will throw an exception.
write_graph()
Read a graph from the specified file:
$graph = $writer->write_graph($file);
The $file argument can either be a filename, or a filehandle for a previously opened file.
SUBCLASSING
To create your own graph format writer, create a module which subclasses Graph::Writer. For example, suppose DGF is a directed graph format
- create a Graph::Writer::DGF module, with the following structure:
package Graph::Writer::DGF;
use Graph::Writer;
use vars qw(@ISA);
@ISA = qw(Graph::Writer);
sub _write_graph
{
my $self = shift;
my $graph = shift;
my $FILE = shift;
while (<$FILE>)
{
}
return 1;
}
1;
Note the leading underscore on the _write_graph() method. The base class provides the public method, and invokes the private method which
you're expected to provide, as above.
If you want to perform additional initialisation at construction time, you can provide an _init() method, which will be invoked by the base
class's constructor. You should invoke the superclass's initialiser as well, as follows:
sub _init
{
my $self = shift;
$self->SUPER::_init();
# your initialisation here
}
Someone can then use your class as follows:
use Graph::Writer::DGF;
$writer = Graph::Writer::DGF->new();
$writer->write_graph($graph, 'foo.dgf');
SEE ALSO
Graph
Jarkko Hietaniemi's modules for representing directed graphs, available from CPAN under modules/by-module/Graph/
Algorithms in Perl
The O'Reilly book has a chapter on directed graphs, which is based around Jarkko's modules.
Graph::Writer::Dot
A simple subclass of this class for writing graphs in the file format used by dot, which is part of the graphviz package from AT&T.
Graph::Writer::VCG
A simple subclass of this class for writing graphs in the file format used by VCG, a tool for visualising directed graphs, initially
developed for visualising compiler graphs.
Graph::Writer::XML
A simple subclass of this class for writing graphs as XML, using a simple graph markup.
Graph::Reader
A baseclass for Graph file format readers.
AUTHOR
Neil Bowers <neil@bowers.com>
COPYRIGHT
Copyright (c) 2001-2012, Neil Bowers. All rights reserved. Copyright (c) 2001, Canon Research Centre Europe. All rights reserved.
This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-02-14 Graph::Writer(3pm)