Assigning your shell variables Variable1 & Variable2 to awk variables V1 & V2:
Splitting each elements in V1 & V2 separated by blank spaces and storing them to an array A1 & A1 (starting index = 1):
Now you can reference any element in your array and do required operation.
Yoda Im testing the solution and it show the first value of both variables and 0.00000 in the third value.
Can you put the code of one example with the values of the variables that I haved pasted with the operation - ?
I need the resulting these same values but with the arhitmetic operation beetween.
Searched all over can't figure out how to compare variables of alpha and numeric characters.
Example a script that ask user to enter a password and then ask to repeat the password. (6 Replies)
Hi guys, How do I compare two variables using diff?
The way I'm thinking:
#!/bin/sh
a=cat asdf.x | wc -l
b=cat asdf.y |cut -d',' -f5 |grep -v '^$' |wc -l
diff $a $b
How to rewrite the above sciprt using only one line in command prompt? (2 Replies)
Is there any way to compare two strings for a greater or less than condition? For example, StringA is "apple" and StringB is "bonnet" and StringC is "captain". Can I only test for equal/not-equal, or is there a way to find out whether StringA is less than StringB, and StringC is greater than... (6 Replies)
Hi,
My first post to this group...
I have a need to to parse a source file which is a capture from a network analyser.
I have two fields that need to be checked:
- Field 7 represents the packet length (an integer), and
Field 4 represents a network address (e.g. 192.168.25.3)
- The... (10 Replies)
Hi All,
I got this script that pulls the Amps value from our RPC's , I basiclly want to compare the valued with a "limit" value -- if the numbers match or are greater than the definded value ...do something. My problem is I cant seem to figure out how to compare floating points...
here is... (1 Reply)
ok this is probably going to turn out to be something really stupid but i've tried to use the following command in a script but the output is just a blank screen and i have to use Ctrl c to exit it.
awk 'BEGIN {printf "%.2f\n", '${bashArray}'>='$Variable' {print '${bashArray}'}}'
the command... (2 Replies)
I am running some commands and I am trying to get an output into a variable. I am having problem when I try to put that value in while loop, it says integer value expected. What's the best way to accomplish this
remaining=$(symclone -sid XXX -f Clone_test query | grep MB | awk '{print... (1 Reply)
Hey guyz,
I have a table which shows the presence or absence of my variables (A,B,C,...) in my observations (1,2,3,...)
* A B C ...
1 1 0 1
2 1 1 0
3 1 0 0
...
I want to calculate the co-presence of my variables. to have a table shows the pairwise presence of the variables (have... (1 Reply)
Hi
PRIM_SEQ=`some sql code`
and output of PRIM_SEQ is like below
120
130
STB_SEQ=`some sql code`
and output of STB_SEQ is like below
115
110
i need to compare this two variables output ( decimal numbers)
1) What I want to do is to compare every number in the PRIM_SEQ with... (8 Replies)
compare two variables and print the difference
i have two variables
X1=rac1,rac2
Y1=rac2,rac3
output=rac1,rac3
Use code tags to wrap code fragments or data samples. (1 Reply)
Discussion started by: jhonnyrip
1 Replies
LEARN ABOUT PHP
_env
_ENV(3) 1 _ENV(3)
$_ENV - Environment variables
An associative array of variables passed to the current script via the environment method.
These variables are imported into PHP's global namespace from the environment under which the PHP parser is running. Many are provided by
the shell under which PHP is running and different systems are likely running different kinds of shells, a definitive list is impossible.
Please see your shell's documentation for a list of defined environment variables.
Other environment variables include the CGI variables, placed there regardless of whether PHP is running as a server module or CGI proces-
sor.
$HTTP_ENV_VARS contains the same initial information, but is not a superglobal. (Note that $HTTP_ENV_VARS and $_ENV are different variables
and that PHP handles them as such)
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 4.1.0 | |
| | |
| | Introduced $_ENV that deprecated $HTTP_ENV_VARS. |
| | |
+--------+---------------------------------------------------+
Example #1
$_ENV example
<?php
echo 'My username is ' .$_ENV["USER"] . '!';
?>
Assuming "bjori" executes this script
The above example will output something similar to:
My username is bjori!
Note
This is a 'superglobal', or automatic global, variable. This simply means that it is available in all scopes throughout a script.
There is no need to do global $variable; to access it within functions or methods.
getenv(3), The filter extension.
PHP Documentation Group _ENV(3)