Im getting this error message when trying to substitute filepaths in a sed search and replace string
#!/usr/bin/ksh
ORACLE_SID=PH3
ORACLE_ADMIN=/data01/app/oracle/admin/$ORACLE_SID
DATAFILE_DIR=/asterisk/oradata/$ORACLE_SID
sed -e s/DBNAME/$ORACLE_SID/g < initPH2.ora | sed -e... (1 Reply)
Dear friends,
please give me the solution to the following query.
If a file contains multiple tags of same name, then how to get the required string between the tags, in which the string begins with "W/X"
i.e., file1.txt contains following text(please note that all the following tags are in... (1 Reply)
I fairly new to SED. I have tried many different variations of this line of code and even breaking it down into its components and running them separately.
They work individually without variables but when I place the $todbname variable it will either inserts the text "connect to $todbname"... (3 Replies)
Hi,
I really need some help, I am using a very basic script to proess a text file. This script has been used many times but all of a sudden all on it's own it's stopped working.
The line in the script is:
sed 's/
//g' $ORGFILE > $NEWFILE
and the error is Sed: command garbled :s/
All... (3 Replies)
for j in $(cat ${list_B})
do
to_replace_2=$(grep $j ${useralias}_2)
sed "s/^${j}/${to_replace_2}/p" ${entries} > ${entries}_2
mv ${entries}_2 ${entries}
done
Hi,
I've the above sed command running in a script. Its basically looping through a file and replacing its beginning of line... (8 Replies)
Hi all,
Suppose that I want to update the db.password entry in the below properties file,
db.username=admin
db.password=qhKkBno2U5GEq5k/dnmGPA== //I want this line to be replaced by: "db.password=abc/123/"
db.host=server
db.port=22
db.sid=database
However when... (2 Replies)
Hi,
First post for a noob so please go easy with me :)
I have a XML block that is originally like this:
<SETNAME>somecrap/THIS</SETNAME>
and I would like it be replaced with, in the original file:
<SETNAME>THIS</SETNAME>
I tried to use:
sed... (4 Replies)
Hi everyone,
Can anyone help me in question below?
I want to cron a job to add partition every month but get the error sed: command garbled: s/YYYYMM/ .
> echo $YYYYMON_NEW
201304
> echo $YYYYMON_OLD
201208
> echo $YYYY_MM_NEW
2013-05
This is my base script:
ALTER TABLE STS.ADMIN ADD... (1 Reply)
Discussion started by: fenocean
1 Replies
LEARN ABOUT PHP
get_class_vars
GET_CLASS_VARS(3) 1 GET_CLASS_VARS(3)get_class_vars - Get the default properties of the classSYNOPSIS
array get_class_vars (string $class_name)
DESCRIPTION
Get the default properties of the given class.
PARAMETERS
o $class_name
- The class name
RETURN VALUES
Returns an associative array of declared properties visible from the current scope, with their default value. The resulting array elements
are in the form of varname => value. In case of an error, it returns FALSE.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.0.3 | |
| | |
| | get_class_vars(3) will only return the properties |
| | that can be accessed from the current scope. |
| | |
| 5.0.2 | |
| | |
| | Calling get_class_vars(3) will now expose all |
| | the properties as an array, unlike previous be- |
| | haviour where protected and private properties |
| | were prefixed with nul bytes. |
| | |
| 5.0.1 | |
| | |
| | Calling get_class_vars(3) will expose all prop- |
| | erties, as when converting an object to a class. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
get_class_vars(3) example
<?php
class myclass {
var $var1; // this has no default value...
var $var2 = "xyz";
var $var3 = 100;
private $var4;
// constructor
function myclass() {
// change some properties
$this->var1 = "foo";
$this->var2 = "bar";
return true;
}
}
$my_class = new myclass();
$class_vars = get_class_vars(get_class($my_class));
foreach ($class_vars as $name => $value) {
echo "$name : $value
";
}
?>
The above example will output:
var1 :
var2 : xyz
var3 : 100
Example #2
get_class_vars(3) and scoping behaviour
<?php
function format($array)
{
return implode('|', array_keys($array)) . "
";
}
class TestCase
{
public $a = 1;
protected $b = 2;
private $c = 3;
public static function expose()
{
echo format(get_class_vars(__CLASS__));
}
}
TestCase::expose();
echo format(get_class_vars('TestCase'));
?>
The above example will output:
// 5.0.0
a| * b| TestCase c
a| * b| TestCase c
// 5.0.1 - 5.0.2
a|b|c
a|b|c
// 5.0.3 +
a|b|c
a
SEE ALSO get_class_methods(3), get_object_vars(3).
PHP Documentation Group GET_CLASS_VARS(3)