Ummm can anybody help me with this one?
Its prob quite simple.
I bascially have a file name say J1x2x3x7.dat
Im using the file name as a variable in a bash script. Want I want to do is extract most of the file name and make it a new variable expect with say one of the number now a... (2 Replies)
Hello everybody,
I am having problem in converting byte array variables to Hexa String variables for Linux. I have done, converting byte array variables to Hexa String variables for Windows but same function doesn't work for linux. Is there any difference in OS ? The code for Windows is given... (2 Replies)
Hi All,
I have a problem assigning variables to script.I have a script in which i have a while loop now i have to assign some values obtained to an array which will be used later in the script.Can anyone help how to do that.
At present my scrot looks like:
co=0
pco=0
co=`cat /tmp/highcpu... (4 Replies)
I have two arrays values
aname = first
aname = last
I would like to assign a variable to both arrays seperated by a comma
fname=(aname","aname)
that example does not work but that's something I would like to accomplish.
Is it possible to assign a printf output to a variable.
... (2 Replies)
Okay, I've made threads on extracting fields and comparing strings in separate files in .csv's. I've written the following code with intentions of learning more.
I just want this one question answered: How can I assign fields from a file(comma separated) to variables?
My goal is to check... (0 Replies)
I am writing some scripts using bash and am wondering if there is a better way to perform the following set of formatting variables.
s1=" "
s2=" "
s3=" "
s4=" "
s5=" "
s6=" "
s7=" "
s8=" "
frmt_titl="${bYl}%s${nClor}\n"
frmt1_titl="${s1}$frmt_titl"... (10 Replies)
I have a bash script with some functions as below and am wondering if I can use the variables declared in setup in the other functions and in the rest of the bash script.
setup(){
none=0; low=1; medium=2; high=3; debug=4
var1="red"
var2="fred"
}
create_basemap() {
... (7 Replies)
Hi All,
i have a requirement where i have to run a script with at least 25 arguements and position of arguements can also change. the unapropriate way is like below. can we achieve this in more good and precise way??
#!/bin/ksh
##script is sample.ksh
age=$1
gender=$2
class=$3
.
.
.... (3 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
define
DEFINE(3) 1 DEFINE(3)define - Defines a named constantSYNOPSIS
bool define (string $name, mixed $value, [bool $case_insensitive = false])
DESCRIPTION
Defines a named constant at runtime.
PARAMETERS
o $name
- The name of the constant.
o $value
- The value of the constant; only scalar and null values are allowed. As of PHP 7 it also possible to use array value. Scalar val-
ues are integer, float, string or boolean values. It is possible to define resource constants, however it is not recommended and
may cause unpredictable behavior.
o $case_insensitive
- If set to TRUE, the constant will be defined case-insensitive. The default behavior is case-sensitive; i.e. CONSTANT and Con-
stant represent different values.
Note
Case-insensitive constants are stored as lower-case.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
CHANGELOG
+--------+---------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------+
| 7.0.0 | |
| | |
| | |
| | array values are allowed. |
| | |
+--------+---------------------------+
EXAMPLES
Example #1
Defining Constants
<?php
define("CONSTANT", "Hello world.");
echo CONSTANT; // outputs "Hello world."
echo Constant; // outputs "Constant" and issues a notice.
define("GREETING", "Hello you.", true);
echo GREETING; // outputs "Hello you."
echo Greeting; // outputs "Hello you."
// Works as of PHP 7
define('ANIMALS', array(
'dog',
'cat',
'bird'
));
echo ANIMALS[1]; // outputs "cat"
?>
SEE ALSO defined(3), constant(3), The section on Constants.
PHP Documentation Group DEFINE(3)