Possible to use /usr/bin/watch to call a function?
I want to have a script both define functions and have the ability to run an external program calling one of them. This is the simplified construct:
So if I invoke /path/to/script one the foo function runs and it exits as expected. I want to ability to run the bar function as if it were a stand-alone program via `/usr/bin/watch bar` but this doesn't work as expected.
How can I accomplish it?
---------- Post updated at 03:18 AM ---------- Previous update was at 02:16 AM ----------
I just set up an ftp server with Red Hat 5.2. I am doing the work, I'm baby stepping, but it seems like every step I get stuck. Currently, I'm trying to set up a crontab job, but I'm getting the following message: /bin/sh: /usr/bin/vi: No such file or directory. I see that vi exists in /bin/vi,... (3 Replies)
Hi all,
below is the problem details:
ora10g@CNORACLE1>which ld
/usr/ucb/ld
ora10g@CNORACLE1>cd /usr/ccs/bin
ora10g@CNORACLE1>ln -s /usr/ucb/ld ld
ln: cannot create ld: File exists
ora10g@CNORACLE1>
how to link it to /usr/ccs/bin? (6 Replies)
Hi!
All the basic linux commands, ie. echo, find, etc, are located in /bin. I have a couple of programs that have these commands pointed towards /usr/bin, ie, /usr/bin/echo (even though the actual 'echo' command is in /bin). How can I alias or redirect or link the /usr/bin to /bin just for this... (6 Replies)
Q1. I understand that /usr/local/bin means I can install/uninstall stuff in here and have any chance of messing up my original system files or effecting any other users. I created this directory myself.
But what about the directory I didn't create, namely /Users/m/bin? How is that directory... (1 Reply)
Hi Experts,
I found that the same commands(sort, du, df, find, grep etc.) exists in both dir.
What is the difference to use them?
i.e: to use xpg4/bin/grep and usr/bin/grep
My OS version is SunOS 5.10
Regards,
Saps (7 Replies)
Hello, I have made a Linux Shell Script that downloads 6 files from the Internet and then deletes them. Now i want to use the function "/usr/bin/time" and "bc" to calculate how long the avergate run time for the shell script is. I therefore need to do it 100 times. My shell script code is below:
... (6 Replies)
Legends,
I am not able to set "expr" function in ksh script.
Below is the sample code i used, and output is as "Syntax error"
Please help me to come out of it.
OUTPUT (9 Replies)
I'm not sure if this is the default behavior for the ld command, but it does not seem to be looking in /usr/local/lib for shared libraries.
I was trying to compile the latest version of Kanatest from svn. The autorgen.sh script seems to exit without too much trouble:
$ ./autogen.sh
checking... (2 Replies)
Discussion started by: AntumDeluge
2 Replies
LEARN ABOUT PHP
get_class
GET_CLASS(3) 1 GET_CLASS(3)get_class - Returns the name of the class of an objectSYNOPSIS
string get_class NULL ([object $object])
DESCRIPTION
Gets the name of the class of the given $object.
PARAMETERS
o $object
- The tested object. This parameter may be omitted when inside a class.
RETURN VALUES
Returns the name of the class of which $object is an instance. Returns FALSE if $object is not an object.
If $object is omitted when inside a class, the name of that class is returned.
ERRORS /EXCEPTIONS
If get_class(3) is called with anything other than an object, an E_WARNING level error is raised.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.0 | |
| | |
| | |
| | NULL became the default value for $object, so |
| | passing NULL to $object now has the same result |
| | as not passing any value. |
| | |
| 5.0.0 | |
| | |
| | The class name is returned in its original nota- |
| | tion. |
| | |
| 5.0.0 | |
| | |
| | The $object parameter is optional if called from |
| | the object's method. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
Using get_class(3)
<?php
class foo {
function name()
{
echo "My name is " , get_class($this) , "
";
}
}
// create an object
$bar = new foo();
// external call
echo "Its name is " , get_class($bar) , "
";
// internal call
$bar->name();
?>
The above example will output:
Its name is foo
My name is foo
Example #2
Using get_class(3) in superclass
<?php
abstract class bar {
public function __construct()
{
var_dump(get_class($this));
var_dump(get_class());
}
}
class foo extends bar {
}
new foo;
?>
The above example will output:
string(3) "foo"
string(3) "bar"
SEE ALSO get_called_class(3), get_parent_class(3), gettype(3), is_subclass_of(3).
PHP Documentation Group GET_CLASS(3)