HELP!!!! I am in an on-line shell programming class and have a question. Here is the data:
Mike Harrington:(510) 548-1278:250:100:175
Christian Dobbins:(408) 538-2358:155:90:201
Susan Dalsass:(206) 654-6279:250:60:50
(There are 12 contribuors total)
This database contains names, phone... (1 Reply)
I want to add a new IP service which executes a script on SCO OS5.
I have amended /etc/services and added to port number (3333)
I have amended /etc/inetd.conf and added a line for this service but I can't get it to execute my own shell script
When I telnet to the IP address on port 3333 I... (1 Reply)
Dear Friends,
I need a help regarding User defined function in shell script.
My problem is as follows:
my_func.sh
my_funcI(){
grep 'mystring' I.dat
}
my_funcQ(){
grep 'mystring' Q.dat
}
myfuncI
myfuncQ
But As both the function has same function only the... (11 Replies)
Hello Friends,
Is it possible to return an array from a user defined function in awk ?
example:
gawk '
BEGIN{}
{
catch_line = my_function(i)
print catch_line
print catch_line
print catch_line
}
function my_function(i)
{
print "echo"
line= "awk"
line= "gawk"... (2 Replies)
Segregated the problematic portion, and showing for your view here.,
1. Following is the function definition,
create or replace function new_del(id integer) returns void as $$
begin
raise info 'dollar :%',$1;
delete from testing where id=$1;
end ;
$$
language 'plpgsql';
... (1 Reply)
I guess what I mean is: is there something like unalias to clear functions defined by sourcing a script or config/alias file from memory?
Is it necessary to start a new terminal session, or can it be done with a command? I tried "function somefunc {}" but bash told me it hit an "unexpected... (0 Replies)
Hello to all,
I am looking for a way to display only the names of function (calls & definition) of a C++ source code.There is already a post related to this, but the script is to find the functions using a specific variable, and the replies are not that convincing since they cannot be used for... (2 Replies)
Hello,
Can anyone guide me tin passing parameters into user defined function of shell script (KSH).
Here is my code,
InsertRecord()
{
DB_TBL=$(sqlplus $USERID/$PASSWORD@$DATABASE << EOF
set head off
set feed off
set serveroutput on
INSERT INTO TBL1 ( OLD_VAL,
NEW_VAL,
... (7 Replies)
Hi, i would like to create user defined commands.
e,g:
if an user executes ,
mkdircd test then a directory called test should be created and it should be cd to test.
How i can create the command mkdircd with below action:
mkdir $1 && cd $1.
Please help me in achieving this (7 Replies)
My requirement is to call function ("fun1") from awk, and print its returned value along with $0.
fun1()
{
t=$1
printf "%02d\n", $t % 60;
}
echo "Hi There 23" | awk '{print $0; system(fun1 $3)}'
Any suggestions what to be modified in above code to achieve requirement.. (5 Replies)
Discussion started by: JSKOBS
5 Replies
LEARN ABOUT DEBIAN
text::roman
Roman(3pm) User Contributed Perl Documentation Roman(3pm)NAME
Text::Roman - Allows conversion between Roman and Arabic algarisms.
SYNOPSIS
use Text::Roman qw/
isroman roman2int int2roman ismilhar milhar2int
roman mroman2int ismroman
/;
print int2roman(123);
$roman = "XXXV";
print roman2int($roman) if isroman($roman);
$milhar = 'L_X_XXIII'; # = 60,023
print milhar2int($milhar) if ismilhar($milhar);
DESCRIPTION
This package supports both conventional Roman algarisms (which range from 1 to 3999) and Milhar Romans, a variation which uses a bar across
the algarism to indicate multiplication by 1,000. For the purposes of this module, acceptable syntax consists of an underscore suffixed to
the algarism e.g. IV_V = 4,005. The term Milhar apparently derives from the Portuguese word for "thousands" and the range of this notation
extends the range of Roman numbers to 3999 x 1000 + 3999 = 4,002,999.
Note: the functions in this package treat Roman algarisms in a case-insensitive manner such that "VI" == "vI" == "Vi" == "vi".
The following functions may be imported into the caller package by name:
isroman
Tests a string to be a valid Roman algarism. Returns a boolean value.
int2roman
Converts an integer expressed in Arabic numerals, to its corresponding Roman algarism. If the integer provided is out of the range
expressible in Roman notation, an undef is returned.
roman2int
Does the converse of int2roman(), converting a Roman algarism to its integer value.
ismilhar
Determines whether a string qualifies as a Milhar Roman algarism.
milhar2int
Converts a Milhar Roman algarism to an integer.
ismroman mroman2int roman
These functions belong to the module's old interface and are considered deprecated. Do not use them in new code and they will eventually
be discontinued; they map as follows:
ismroman => ismilhar
mroman2int => milhar2int
roman => int2roman
CHANGES
Some changes worth noting from this module's previous incarnation:
namespace imports
The call to use must now explicitly request function names imported into its namespace.
argument defaults/void context
All functions now will operate on $_ when no arguments are passed, and will set $_ when called in a void context. This allows for
writing code like:
@x = qw/V III XI IV/;
roman2int() for @x;
print join("-", @x);
instead of the uglier:
@x = qw/V III XI IV/;
$_ = roman2int($_) for @x;
print join("-", @x);
SPECIFICATION
Roman algarisms may be described using the following BNF-like formula:
a = I{1,3}
b = Va?|IV|a
e = X{1,3}?|X{0,3}IX|
ee = IX|
f = Le?|XLee?|e
g = C{1,3}f?|C{0,3}XCee?|f
gg = XCee?|f
h = Dg?|CDgg?|g
j = M{1,3}h?|M{0,3}CMgg?|h
REFERENCES
For a description of the Roman numeral system see: http://www.novaroma.org/via_romana/numbers.html. A reference to Milhar Roman alagarisms
(in Portuguese) may be found at: http://www.estado.estadao.com.br/redac/norn-nro.html.
AUTHOR
Erick Calder <ecalder@cpan.org>
ACKNOWLEDGEMENTS
This module was originally written by Peter de Padua Krauss <krauss@ifqsc.sc.usp.br> and submitted to CPAN by Stanislaw Pusep <stanis@lin-
uxmail.org> who has relinquished control to me since the original author has never maintained it and can no longer be reached.
I have completely rewritten the module, implementing simpler algorithms to perform the same functionality, adding a test suite, a Changes
file, etc. and providing more comprehensive documentation.
AVAILABILITY + SUPPORT
For questions, comments and support please feel free to e-mail me. This module may be found on the CPAN. Additionally, both the module
and its RPM package are available from:
http://perl.arix.com
DATE
$Date: 2003/01/16 01:56:34 $
VERSION
$Revision: 3.3 $
perl v5.8.8 2007-06-15 Roman(3pm)