Thanks for the extra info. It makes more sense now that I know you were assuming i was running it like this:
cat $file|yourscript.ksh
The source file is basically static so the file it reads through is hardcoded into the script - i don't pass anything to the main ksh script.
I made a copy of the script and I'm trying a variation of what you suggested. I changed the read loop so that it greps the file prior to reading the lines. I removed the cat statement since it seem like it might be a UUOC - if there's a good reason to cat the file then pipe to grep let me know. Here's the read loop I'm testing.
Thanks again!!
---------- Post updated at 02:38 PM ---------- Previous update was at 02:30 PM ----------
Tony,
i tried your suggestion and still had some problems...thanks for the idea though.
First I' d like to say you guys are awesome. :)
I have a word document that I cut and paste into Textpad and it removed all the fancy formatting which is fine with me. I WinScp'd it to the box and and called it inputfile.txt.
Opened it in vi and don't see any special characters or stuff that... (2 Replies)
I am having problem with ftp not indicating any error, but my customer is complaining that their response file is not present on their machine. This only happens a couple of times a day. Is there a debugging option I can turn on to the trace the ftp command. I have a return code displayed and it... (2 Replies)
Hi all ,
I just installed a Solaris10 on x86 machine , running on vmware . I was able to telnet from my local machine to the solaris ( the one running on the vmware) , but the connection was pretty slow and intermittent . Is there any setting that I should customize to ensure the telnet... (2 Replies)
I am trying to read input for a C program (that expects input from the user) from a file using the shell command:
progname < filename
but it seems that the program considers the char '<'
as the first input, hence causing an "error" in my program.
I checked it with another program and it... (2 Replies)
Hi guys,
I am new to AWK and unix scripting. Please see below my problem and let me know if anyone you can help.
I have 2 input files (example given below)
Input file 2 is a standard file (it will not change) and we have to get the name (second column after comma) from it and append it... (5 Replies)
Alright, so the goal of my script is to read text from standard input and store it into a file using the ex-editor:
so far i've got this, but it doesn't work.
#!/bin/s
read text
ex $1 >> HERE
text
HERE
I don't get any errors either, so i don't know what i'm doing wrong. (7 Replies)
Hi,
I need to read the date from the input file. The format of the input file is as follows:
a_b_c_yyyymmdd.txt
I need to read the date(yyyymmdd) part from the name of the input file.
Would really appreciate if someone can help me in this regard
Thanks a lot. (1 Reply)
echo "Enter the Value : "
read value
sed '1s:\(.\{6\}\)\(.\{4\}\):\1'$value':' flextran$RUN_DATE-completed.txt > temp.txt
mv temp.txt flextran$RUN_DATE-completed.txt
on the run time after entering the input value it waits for keystroke and the values is not input to the function
The output... (4 Replies)
Hi all,
I have a little problem with my shell script (reading user input, save user input to variable, invisible characters in the log file :()
printf "1. What's your file path?"
/path/to/my/file
read -e FILE
I have invisible characters in my log file (e.g. <ESC> or ^G) when I'm... (3 Replies)
I am not able to capture the user input in this script(bash).There is prompt for user input.Could some one help me capture user input while reading afile?
while read line
do
echo "$i"
path1=$line
path2=`echo $line|sed s/new_dir/old_dir/`
echo "Do you want to replace?";... (4 Replies)
Discussion started by: parijat guh
4 Replies
LEARN ABOUT REDHAT
pod::plaintext
Pod::PlainText(3pm) Perl Programmers Reference Guide Pod::PlainText(3pm)NAME
Pod::PlainText - Convert POD data to formatted ASCII text
SYNOPSIS
use Pod::PlainText;
my $parser = Pod::PlainText->new (sentence => 0, width => 78);
# Read POD from STDIN and write to STDOUT.
$parser->parse_from_filehandle;
# Read POD from file.pod and write to file.txt.
$parser->parse_from_file ('file.pod', 'file.txt');
DESCRIPTION
Pod::PlainText is a module that can convert documentation in the POD format (the preferred language for documenting Perl) into formatted
ASCII. It uses no special formatting controls or codes whatsoever, and its output is therefore suitable for nearly any device.
As a derived class from Pod::Parser, Pod::PlainText supports the same methods and interfaces. See Pod::Parser for all the details;
briefly, one creates a new parser with "Pod::PlainText->new()" and then calls either parse_from_filehandle() or parse_from_file().
new() can take options, in the form of key/value pairs, that control the behavior of the parser. The currently recognized options are:
alt If set to a true value, selects an alternate output format that, among other things, uses a different heading style and marks "=item"
entries with a colon in the left margin. Defaults to false.
indent
The number of spaces to indent regular text, and the default indentation for "=over" blocks. Defaults to 4.
loose
If set to a true value, a blank line is printed after a "=head1" heading. If set to false (the default), no blank line is printed
after "=head1", although one is still printed after "=head2". This is the default because it's the expected formatting for manual
pages; if you're formatting arbitrary text documents, setting this to true may result in more pleasing output.
sentence
If set to a true value, Pod::PlainText will assume that each sentence ends in two spaces, and will try to preserve that spacing. If
set to false, all consecutive whitespace in non-verbatim paragraphs is compressed into a single space. Defaults to true.
width
The column at which to wrap text on the right-hand side. Defaults to 76.
The standard Pod::Parser method parse_from_filehandle() takes up to two arguments, the first being the file handle to read POD from and the
second being the file handle to write the formatted output to. The first defaults to STDIN if not given, and the second defaults to STD-
OUT. The method parse_from_file() is almost identical, except that its two arguments are the input and output disk files instead. See
Pod::Parser for the specific details.
DIAGNOSTICS
Bizarre space in item
(W) Something has gone wrong in internal "=item" processing. This message indicates a bug in Pod::PlainText; you should never see it.
Can't open %s for reading: %s
(F) Pod::PlainText was invoked via the compatibility mode pod2text() interface and the input file it was given could not be opened.
Unknown escape: %s
(W) The POD source contained an "E<>" escape that Pod::PlainText didn't know about.
Unknown sequence: %s
(W) The POD source contained a non-standard internal sequence (something of the form "X<>") that Pod::PlainText didn't know about.
Unmatched =back
(W) Pod::PlainText encountered a "=back" command that didn't correspond to an "=over" command.
RESTRICTIONS
Embedded Ctrl-As (octal 001) in the input will be mapped to spaces on output, due to an internal implementation detail.
NOTES
This is a replacement for an earlier Pod::Text module written by Tom Christiansen. It has a revamped interface, since it now uses
Pod::Parser, but an interface roughly compatible with the old Pod::Text::pod2text() function is still available. Please change to the new
calling convention, though.
The original Pod::Text contained code to do formatting via termcap sequences, although it wasn't turned on by default and it was problem-
atic to get it to work at all. This rewrite doesn't even try to do that, but a subclass of it does. Look for Pod::Text::Termcap.
SEE ALSO
Pod::Parser, Pod::Text::Termcap, pod2text(1)AUTHOR
Russ Allbery <rra@stanford.edu>, based very heavily on the original Pod::Text by Tom Christiansen <tchrist@mox.perl.com> and its conversion
to Pod::Parser by Brad Appleton <bradapp@enteract.com>.
perl v5.8.0 2002-06-01 Pod::PlainText(3pm)