Hi there,
the following script doesn't work. the first part works, then the second 'grep' fails with ': not found'. However, if I take out the second part (starting with the grep command) and put in a seperate script, it works.
everyone know what's wrong here? no two 'grep' in one script, that sounds weird?
Last edited by vgersh99; 03-11-2010 at 06:35 PM..
Reason: code tags, please!
I am trying to run the following code from a script file but it complains that syntax of (both instances of) grep is wrong.
When I copy and paste it to the terminal, it is OK. Any idea what the problem might be?
set i = `grep -c #define flags.h`
while ($i>20)
@ i--
my func (`cat... (4 Replies)
Howdie everyone...
I have a shell script RemoveFiles.sh
Inside this file, it only has two commands as below:
rm -f ../../reportToday/temp/*
rm -f ../../report/*
My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Hi there. I'm new to scripting in bash shell and I have this problem.
I'm trying to make a script that returns the greatest common divisor of two integer numbers according to Euclid's algorithm...
Here is, what I've done:
#!/bin/bash
m=$1
n=$2
while
do
if ; #line 8
then m=$m-$n... (1 Reply)
grep -e doesn't work in Soalris.
Same script with grep -e worked on AIX/HP/LINUX..
I would like to search a list of patterns on "log.txt" like ...
grep -e FATAL -e ERROR log.txt
I get the error message as
grep: illegal option -- e
Usage: grep -hblcnsviw pattern file . . . (3 Replies)
I am trying to find only those entries where 7018 and another number appear in the end of the line.
7018 2828 1423 2351
7018 2828 14887
2828 7018 1222
123 7018 1487
I am looking for a way to generate only the last two lines. I was trying to do just "grep '7018{1,5}" but it does not... (5 Replies)
Hello,,
Im verry new to scripting and have some problems with this script i made..
What it does:
It checks a directory for a new directory and then issues a couple of commands.
checks sfv - not doing right now
checks rar - it checks if theres a rar file and when there is it skips to... (1 Reply)
Hi all,
I need some help. my shell script doesn't work especially in the loop.
#!/bin/sh -xv
export ORA_ADMIN=/oracle/home/admin
export ORACLE_SID=ORA_SID
cat ${ORA_ADMIN}/param_alert_log.ora | while read MSG
do
#echo $MSG
#echo "tail -400... (8 Replies)
i have this script and when i ejecute it, the console tell me this " sintax error line 41 unexpected element "}" "
is the sintaxis ok?
#!/bin/bash
if ;then
{
exit 0;
}
if ; then
{
sudo /etc/init.d/apache2 start;
sudo /etc/init.d/mysql start;
php5 &
nautilus... (3 Replies)
Hi,
I'm trying to write a script that checks gvfs to see if a mount exists so I can run it from network-manager's status hooks. I thought I'd pipe the output of gvfs-mount -l to grep for the particular mounts I care about. When I do this in a bash script:
cmnd="gvfs-mount -l | grep -i... (4 Replies)
Hello,
First of all, I'd like to say hello to all members of forum.
Can You please help me with the matter described below?
I am trying to fetch a data from the file to variable, I am doing this using below script:
returned=`tail -50 SapLogs.log | grep -i -E "Error|"`
echo $returned
... (2 Replies)
Discussion started by: jedzio
2 Replies
LEARN ABOUT PHP
classkit_method_add
CLASSKIT_METHOD_ADD(3) 1 CLASSKIT_METHOD_ADD(3)classkit_method_add - Dynamically adds a new method to a given classSYNOPSIS
bool classkit_method_add (string $classname, string $methodname, string $args, string $code, [int $flags = CLASSKIT_ACC_PUBLIC])
DESCRIPTION
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 to which this method will be added
o $methodname
- The name of the method to add
o $args
- Comma-delimited list of arguments for the newly-created method
o $code
- The code to be evaluated when $methodname is called
o $flags
- The type of method to create, 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_add(3) example
<?php
class Example {
function foo() {
echo "foo!
";
}
}
// create an Example object
$e = new Example();
// Add a new public method
classkit_method_add(
'Example',
'add',
'$num1, $num2',
'return $num1 + $num2;',
CLASSKIT_ACC_PUBLIC
);
// add 12 + 4
echo $e->add(12, 4);
?>
The above example will output:
16
SEE ALSO classkit_method_copy(3), classkit_method_redefine(3), classkit_method_remove(3), classkit_method_rename(3), create_function(3).
PHP Documentation Group CLASSKIT_METHOD_ADD(3)