08-29-2011
Quote:
Originally Posted by
KenJackson
Neo, you're being inconsistent.
But to try to introduce a modicum of consistency, please delete the word "Religious" from "Crazy people unleash a deady Virus (Politics, Religion)" (and correct the spelling of "deadly"), and "Spiritual" from "Other (Personal, Spiritual)".
OK. Deleted.
7 More Discussions You Might Find Interesting
1. Programming
So, this is my first C++ program under linux. My OS is Red Hat 8.0, and my codes are like following:
$vi hello.cpp
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
$ g++ -o hello hello.cpp
the error message are: ... (3 Replies)
Discussion started by: HOUSCOUS
3 Replies
2. Shell Programming and Scripting
Hi, I read a .txt file with read command. while read PC USER PASS SHARE EXCL
do
...
done
The file is like this: pc1 usr pc01 parts
pc2 usr pc02 parts nobackup
pc3 usr pc03 parts
pc4 usr pc04 parts
pc10 usr pc10 parts nobackup
pc13 usr pc13 share,share_2 noshare,noshare_2But if I want... (3 Replies)
Discussion started by: mbarberis
3 Replies
3. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
4. Shell Programming and Scripting
Hi,
Could anyone please shed some light on the following script lines and what is it doing as it was written by an ex-administrator?
cat $AMS/version|read a b verno d
DBVer=$(/usr/bin/printf "%7s" $verno)
I checked that the cat $AMS/version command returns following output:
... (10 Replies)
Discussion started by: dbadmin100
10 Replies
5. Programming
Hello!
I have a question to native English-speaking people. In the popular program's "hello world" greeting, what meaning the "world" has: "all", "everybody", "people", "friends" or "whole world", "planet", "Earth", "Universe"?
In other words, to whom this greeting is addressed: to the... (14 Replies)
Discussion started by: Eugene Muzychen
14 Replies
6. Shell Programming and Scripting
Hello All,
I have an Expect script that ssh's to a remote server and runs some commands before exiting.
One of the commands I run is the "hostname" Command. After I run this command I save the output
using this line in the code below...
Basically it executes the hostname command, then I... (2 Replies)
Discussion started by: mrm5102
2 Replies
7. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
STRISTR(3) 1 STRISTR(3)
stristr - Case-insensitivestrstr(3)
SYNOPSIS
string stristr (string $haystack, mixed $needle, [bool $before_needle = false])
DESCRIPTION
Returns all of $haystack starting from and including the first occurrence of $needle to the end.
PARAMETERS
o $haystack
- The string to search in
o $needle
- If $needle is not a string, it is converted to an integer and applied as the ordinal value of a character.
o $before_needle
- If TRUE, stristr(3) returns the part of the $haystack before the first occurrence of the $needle (excluding needle).
$needle and $haystack are examined in a case-insensitive manner.
RETURN VALUES
Returns the matched substring. If $needle is not found, returns FALSE.
CHANGELOG
+--------+-----------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+-----------------------------------------------+
| 5.3.0 | |
| | |
| | Added the optional parameter $before_needle. |
| | |
| 4.3.0 | |
| | |
| | stristr(3) was made binary safe. |
| | |
+--------+-----------------------------------------------+
EXAMPLES
Example #1
stristr(3) example
<?php
$email = 'USER@EXAMPLE.com';
echo stristr($email, 'e'); // outputs ER@EXAMPLE.com
echo stristr($email, 'e', true); // As of PHP 5.3.0, outputs US
?>
Example #2
Testing if a string is found or not
<?php
$string = 'Hello World!';
if(stristr($string, 'earth') === FALSE) {
echo '"earth" not found in string';
}
// outputs: "earth" not found in string
?>
Example #3
Using a non "string" needle
<?php
$string = 'APPLE';
echo stristr($string, 97); // 97 = lowercase a
// outputs: APPLE
?>
NOTES
Note
This function is binary-safe.
SEE ALSO
strstr(3), strrchr(3), stripos(3), strpbrk(3), preg_match(3).
PHP Documentation Group STRISTR(3)