04-16-2014
Dear wisecracker
Thank you for the reply. sleep 10 was just display something on the screen.
can you please help me by providing the code so that can call the function from outside unless my search gets the the wrd it wants.
Regards,
Ravi
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello all
In UNIX i wrote a program which simply establishes a conncetion with another system, using write system call i wrote a message to the server from client and from the server i send another message, for the second time i send a mesage using write system call to the server, when i send a... (1 Reply)
Discussion started by: rajashekaran
1 Replies
2. Programming
I use fopen, fscanf, fclose to read a file. It can work well. since many files should be read, a function is created with the same code. But in the function, fscanf can not work well.
for example, the first line of the the file is: > filename
but the fscanf will give: 207/23/eee/34
it appears... (2 Replies)
Discussion started by: cdbug
2 Replies
3. Programming
# include <stdio.h>
# include <fcntl.h>
# include <stdlib.h>
# include <sys/stat.h>
int main(int argc, char *argv)
{
int fRead, fPadded, padVal;
int btRead;
int BUFFSIZE = 512;
char buff;
if (argc != 4)
{
printf ("Please provide all of the... (3 Replies)
Discussion started by: naranja18she
3 Replies
4. Shell Programming and Scripting
Hi al,
Im trying to write something to read a date file and append each date to my file output name.
Datefile:
20091001
20091015
Final output file I would like is:
DATA_20091001_20091015.xls
The script Im trying, but not working, is
n=`wc -l < dates_yymmdd.txt`
i=1 (2 Replies)
Discussion started by: NycUnxer
2 Replies
5. UNIX for Advanced & Expert Users
Hi Thinkers,
On AIX 5.3, we have a monitor program that reads the log file and searching for a certain string pattern that we define(say "transactionException"), if it sees it then it will raise an alert by sending an email.
Because the log file XXX.log is rolling into XXX.log.0, XXX.log.1,... (2 Replies)
Discussion started by: TheGunMan
2 Replies
6. Shell Programming and Scripting
Hi
I am new to Unix shell scripting. But i need help to slove the below issue.
Issue description:
I want to read table, view names and package names in a file
my plan to find the table name is : search "From" key word find the table or view
To find the packge name : Search "Package... (5 Replies)
Discussion started by: sboss
5 Replies
7. AIX
I have a oracle 10 G database installed on AIX6.1) server.
The database user creates online redo log files with permissions 640 i.e. read access to group oinstall
I am not able to read the files with another user part of the group oinstall. even tried to copy the files to another location,... (5 Replies)
Discussion started by: amitnm1106
5 Replies
8. Homework & Coursework Questions
After some thought.
I am uncomfortable issuing my professors name where, there may be unintended side effects from any negative responses/feedback. Willing to re post if I can omit school / professor publicly, but can message moderator for validation? I am here for knowledge and understanding,... (1 Reply)
Discussion started by: briandanielz
1 Replies
9. Shell Programming and Scripting
Hi.
How can I create a history function? (By "read" command or so)
&
How can I configure a read command so that the arrow keys are not displayed so funny? (^[[A)
Thanks in advance. (4 Replies)
Discussion started by: sinnlosername
4 Replies
10. Shell Programming and Scripting
I'm working on Aix 6.1 and using ksh shell.
The below works fine on Linux bash or ksh shell .
while IFS= read -r dirpath ; do
echo "Hi"
done <<<"$var"
However, any such while loop that reads the input from file or variable using <<< fails on Aix system with the below error:
Below... (2 Replies)
Discussion started by: mohtashims
2 Replies
LEARN ABOUT DEBIAN
class::makemethods::utility::textbuilder
MakeMethods::Utility::TextBuilder(3pm) User Contributed Perl Documentation MakeMethods::Utility::TextBuilder(3pm)
NAME
Class::MakeMethods::Utility::TextBuilder - Basic text substitutions
SYNOPSIS
print text_builder( $base_text, @exprs )
DESCRIPTION
This module provides a single function, which implements a simple "text macro" mechanism for assembling templated text strings.
$expanded_text = text_builder( $base_text, @exprs )
Returns a modified copy of $base_text using rules from the @exprs list.
The @exprs list may contain any of the following:
o A string, in which any '*' characters will be replaced by the base text. The interpolated string then replaces the base text.
o A code-ref, which will be called with the base text as its only argument. The result of that call then replaces the base text.
o A hash-ref, which will be added to the substitution hash used in the second pass, below.
o An array-ref, containing additional expressions to be treated as above.
After any initial string and code-ref rules have been applied, the hash of substitution rules are applied.
The text will be searched for occurances of the keys of the substitution hash, which will be modified based on the corresponding value in
the hash. If the substitution key ends with '{}', the search will also match a balanced block of braces, and that value will also be used
in the substitution.
The hash-ref may contain the following types of rules:
o 'string' => 'string'
Occurances of the first string are to be replaced by the second.
o 'string' => code_ref
Occurances of the string are to be replaced by the results of calling the subroutine with no arguments.
o 'string{}' => 'string'
Occurances of the first string and subsequent block of braces are replaced by a copy of the second string in which any '*' characters
have first been replaced by the contents of the brace block.
o 'string{}' => code_ref
Occurances of the string and subsequent block of braces are replaced by the results of calling the subroutine with the contents of the
brace block as its only argument.
o 'string{}' => hash_ref
Occurances of the string and subsequent block of braces are replaced by using the contents of the brace block as a key into the
provided hash-ref.
EXAMPLE
The following text and modification rules provides a skeleton for a collection letter:
my $letter = "You owe us AMOUNT. Please pay up!
" .
"THREAT{SEVERITY}";
my @exprs = (
"Dear NAMEm
*",
"*
-- The Management",
{ 'THREAT{}' => { 'good'=>'Please?', 'bad'=>'Or else!' } },
" DATE
*",
{ 'DATE' => 'Tuesday, April 1, 2001' },
);
One might invoke this template by providing additional data for a given instance and calling the text_builder function:
my $item = { 'NAME'=>'John', 'AMOUNT'=>'200 camels', 'SEVERITY'=>'bad' };
print text_builder( $letter, @exprs, $item );
The resulting output is shown below:
Tuesday, April 1, 2001
Dear John,
You owe us 200 camels. Please pay up!
Or else!
-- The Management
SEE ALSO
See Class::MakeMethods for general information about this distribution.
perl v5.10.1 2004-09-06 MakeMethods::Utility::TextBuilder(3pm)