So far this is awesome! Going to have to run it against a few test MKV's to see that it's reliably getting that correct information - thank you so much!
I am working with the Oracle 10.2.0.3 job scheduler on Solaris 10, and unfortunately, the scheduler executes scripts in such a way that several default shell environment variables are not defined. For example, $HOME, $USER, and $LOGNAME are missing.
How can I parse the appropriate record in... (7 Replies)
I am writing a script to keep check on free disk space, and I would like to find a way to parse $LINE (see code below) into a numeric value (for free disk space percentage) and a string value (for mount point). If possible, I would like to avoid sed or any additional use of awk since I am not very... (7 Replies)
I'm working in korn shell and have a variable which contains a string like:
aa_yyyymmdd_bbb_ccc_ddd.abc. I want to treat the _ and . as delimiters and parse the string so I end up with 6 values in variables that I can manipulate. My original plan was to use
var1=`echo $sting1 | cut -c1-c2` but... (9 Replies)
Hi,
I have a config file that has blank, commented lines. I need to escape commented lines, blank lines, parse the remaining lines and store them in variables or array.
the config file contains the following lines.
# config file
# Define Oracle User
ORA_USER=abcde
ORA_PASS=xyzabc... (8 Replies)
Hello
I need to pass some environment parameters to a datastage job and am getting an error when trying to send the complete concatinated variable. I have decided to parse out just the values and send as parameters but am struggling to find the best way to do this (actually I am not very... (3 Replies)
For example, I have a file with below lines containing VOB tags and VOB paths.
* /vobs/fts/FTSUSM20_VOB /ccvobsslx01/projects/vobs/eml/FTSUSM20_VOB
* /vobs/fts/FTS20_VOB /ccvobsslx01/projects/vobs/eml/FTS20_VOB
* /vobs/pmv/PMS_VOB /ccvobsslx01/projects/vobs/cpm/_/PMS_VOB
*... (4 Replies)
hi,
i have the followiing scenario where by i am parsing teh following output using cut -d
like so
#!/bin/bash
output="ABCTable|
------------------|
|
------------------|
code |
name |
amount |"
col1= $output | cut -d'|' -f5
col2= $output | cut -d'|'... (1 Reply)
Hi there, would appreciate some help on this parsing problem if anybody can help
im trying to parse a variable with the following output, each of the values im trying to parse are deliminated by a ;
T192... (8 Replies)
Trying to do so
echo "111:222:333" |awk -F: '{system("export TESTO=" $2)}'But it doesn't work (2 Replies)
Discussion started by: urello
2 Replies
LEARN ABOUT PHP
eval
EVAL(3) 1 EVAL(3)eval - Evaluate a string as PHP codeSYNOPSIS
mixed eval (string $code)
DESCRIPTION
Evaluates the given $code as PHP.
Caution
The eval(3) language construct is very dangerous because it allows execution of arbitrary PHP code. Its use thus is discouraged.
If you have carefully verified that there is no other option than to use this construct, pay special attention not to pass any user
provided data into it without properly validating it beforehand.
PARAMETERS
o $code
- Valid PHP code to be evaluated. The code mustn't be wrapped in opening and closing PHP tags, i.e. 'echo "Hi!";' must be passed
instead of '<? echo "Hi!"; >'. It is still possible to leave and reenter PHP mode though using the appropriate PHP tags, e.g.
'echo "In PHP mode!"; ?>In HTML mode!<? echo "Back in PHP mode!";'. Apart from that the passed code must be valid PHP. This
includes that all statements must be properly terminated using a semicolon. 'echo "Hi!"' for example will cause a parse error,
whereas 'echo "Hi!";' will work. A return statement will immediately terminate the evaluation of the code. The code will be exe-
cuted in the scope of the code calling eval(3). Thus any variables defined or changed in the eval(3) call will remain visible
after it terminates.
RETURN VALUES eval(3) returns NULL unless return is called in the evaluated code, in which case the value passed to return is returned. If there is a
parse error in the evaluated code, eval(3) returns FALSE and execution of the following code continues normally. It is not possible to
catch a parse error in eval(3) using set_error_handler(3).
EXAMPLES
Example #1
eval(3) example - simple text merge
<?php
$string = 'cup';
$name = 'coffee';
$str = 'This is a $string with my $name in it.';
echo $str. "
";
eval("$str = "$str";");
echo $str. "
";
?>
The above example will output:
This is a $string with my $name in it.
This is a cup with my coffee in it.
NOTES
Note
Because this is a language construct and not a function, it cannot be called using variable functions.
Tip
As with anything that outputs its result directly to the browser, the output-control functions can be used to capture the output of
this function, and save it in a string (for example).
Note
In case of a fatal error in the evaluated code, the whole script exits.
SEE ALSO call_user_func(3).
PHP Documentation Group EVAL(3)