Hi,
I have a file on unix which contains
--------------------------------------
1 # Do not remove the following line, or various programs
2 # that require network functionality will fail.
3 127.0.0.1 romhelp3 localhost.localdomain localhost
4
... (2 Replies)
I have a file that I want to split in 2 (with Bourne shell sh) preferably. The file consists of groups of lines separated by newline. The file can vary in length, so I need to check number of groups of text. Here's an example
====EXAMPLE START====
#fruit banana
#color yellow
#surface smooth... (0 Replies)
Hi,
I want to read the 3rd column of the v_string into a script variable v_3rd, can anyone help howto?
v_string="This is for testing only"
Thanks!
Victor Cheung (2 Replies)
Heeloo all,
A weird problem perhaps. May god save others from this problem.
I want to print each line from a variable.. the example below should make it clear.
smvar="Hello World1
Hello world 2
forgot there I guess"
for eachline in $smvar
echo $eachline
end
Whats for... (3 Replies)
Hello,
I am trying to do the following;
bzcat data.in.bz2 | split -l 1000000 -d
this work great, except that once the files have been split, they are not in the directory I want them to be in. So I then have to move them, at times this can get hairy.
Is there anyway to specify where the... (4 Replies)
HI guys i have a question.
Question 1: how do i modify a particular string?
e.g
echo "Please enter Book Title: "
read a
echo "Please enter Author: "
read b
if ]
then echo " Record found!"
which will then pop out a menu with the follow output
1. Update Name
2.... (1 Reply)
Hi there,
I have an output from a command like this
# ypcat -k netgroup.byuser| grep steven
steven.* users_main,users_sysadmin,users_global,users_backup_team
and wanted to pull the 'users' netgroups returned into a perl array, that will look like this
users_main... (2 Replies)
Hi
I have a text like this
example.input
1 red
2 blue
3 green
If I set this
c=2
Then try
awk 'NR==$c { print $2 }' example.input
I do get nothing
If I try
awk 'NR==2 { print $2 }' example.input
i get
blue (8 Replies)
Hello,
Although I have found similar questions, I could not find advice that could help with our problem.
The issue:
We have a few thousands text files (books).
Each book has many chapters. Each chapter is identified by a cite-key. We need
to split each of those book files by... (4 Replies)
Hi Everyone,
Is there a way I can print specific lines using sed -n '3,3p' file.dat or awk 'FNR==3' file.dat when using variable?
For example, I have this script (get_line.ksh) that accepts line parameter that a user wanted to print in the file.dat.
file.dat
one
two
three
four
... (1 Reply)
Discussion started by: zzavilz
1 Replies
LEARN ABOUT PHP
classkit_method_redefine
CLASSKIT_METHOD_REDEFINE(3) 1 CLASSKIT_METHOD_REDEFINE(3)classkit_method_redefine - Dynamically changes the code of the given methodSYNOPSIS
bool classkit_method_redefine (string $classname, string $methodname, string $args, string $code, [int $flags = CLASSKIT_ACC_PUBLIC])
DESCRIPTION
Note
This function cannot be used to manipulate the currently running (or chained) method.
Warning
This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in
a future release of PHP. This function should be used at your own risk.
PARAMETERS
o $classname
- The class in which to redefine the method
o $methodname
- The name of the method to redefine
o $args
- Comma-delimited list of arguments for the redefined method
o $code
- The new code to be evaluated when $methodname is called
o $flags
- The redefined method can be CLASSKIT_ACC_PUBLIC, CLASSKIT_ACC_PROTECTED or CLASSKIT_ACC_PRIVATE
Note
This parameter is only used as of PHP 5, because, prior to this, all methods were public.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
classkit_method_redefine(3) example
<?php
class Example {
function foo() {
return "foo!
";
}
}
// create an Example object
$e = new Example();
// output Example::foo() (before redefine)
echo "Before: " . $e->foo();
// Redefine the 'foo' method
classkit_method_redefine(
'Example',
'foo',
'',
'return "bar!
";',
CLASSKIT_ACC_PUBLIC
);
// output Example::foo() (after redefine)
echo "After: " . $e->foo();
?>
The above example will output:
Before: foo!
After: bar!
SEE ALSO classkit_method_add(3), classkit_method_copy(3), classkit_method_remove(3), classkit_method_rename(3).
PHP Documentation Group CLASSKIT_METHOD_REDEFINE(3)