I have not tried to execute a command within the subject line but often include variables. You can try executing the command using "`" back ticks like;
or if that does not work
[/code]
Can someone please tell me how to modify/add to this code so that it recognizes UNIX command options (all beginning with "-") and executes the command with options?
#include<stdio.h>
#include<stdlib.h>
int main(int argc, char *argv)
{
int i;
system("stty -echo");
... (8 Replies)
If anyone can give me some ideas on this it would be great. What I'm trying to do is to have emails be sent to my unix account. Once they are emailed to the unix account, I want to use the text in the subject field to invoke a shell script, so basically I need to find a way that I can... (4 Replies)
Hi All,
I have a script that reads a file and echo it back to std out.
Test.txt
1aaaaaaaaaaa .
The script is ReadLine.sh
#!/bin/ksh
cat $1 | while read file
do
echo $file
done
I invoke the script as ReadLine.sh Test.txt
The output that I get is (1 Reply)
I want to instert Category:XXXXX into the 2. line
something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong:
sed "2i\\${n}Category:$cat\n"
Sample:
Titel Blahh Blahh abllk sdhsd sjdhf
Blahh Blah Blahh
Blahh
Should look like... (2 Replies)
Hi All,
Can anyone please provide the command for sending an mail with attachment using mailx command.
Thanks in Advance :)
Regards,
Siram. (3 Replies)
Hi ,
I want to add date to the subject of the email. I am using mail and used
-s "SQL Loader was not able to load enid on `date` due to data error"
But it didnt work. can any one help me ??
Thanks
Sithara (1 Reply)
Hi,
I need to extract the subject of an e-mail sent using mailx. mailx is in a a file and the command reads like the following
Ex: sendMail.sh
mailx -s ' This is the subject' $recepiant
note that anything can come within ' ' which goes to the subject.
Please help (5 Replies)
I'm finally about to make the jump from PHP's mysql driver to the newer mysqli one using the mysqli converter tool.
The tool is called by this command line:
php /usr/share/nginx/html/rather/converter/cli.php -d -p ".php,.shtml,.inc" -u -b -v -w >> /tmp/convert.log
e.g. at the web root:... (2 Replies)
Hi All,
I want to send the csv to an email address.
I have tried the below two approaches.
Approach1: Got error -ksh: uuencode: not found
$ uuencode test_file.csv test_file.csv | mailx -s "Attaching test" msdc.kiran@gmail.com </usr/home/test_file.csv
-ksh: uuencode: not found
Approach2:... (6 Replies)
Hi
Newbie here with first post. I've got a shell script (ksh) whereby I run a SQL*Plus script and output the results to a file. I then check the output file in an if statement that looks like this:
if ]; then
export GAPNUM=`awk '{print $4}' $OUTFILE`
if ] then
mailx -s... (10 Replies)
Discussion started by: ltzwoman
10 Replies
LEARN ABOUT PHP
strspn
STRSPN(3) 1 STRSPN(3)strspn - Finds the length of the initial segment of a string consisting entirely of characters contained within a given mask.SYNOPSIS
int strspn (string $subject, string $mask, [int $start], [int $length])
DESCRIPTION
Finds the length of the initial segment of $subject that contains only characters from $mask.
If $start and $length are omitted, then all of $subject will be examined. If they are included, then the effect will be the same as call-
ing strspn(substr($subject, $start, $length), $mask) (see "substr" for more information).
The line of code:
<?php
$var = strspn("42 is the answer to the 128th question.", "1234567890");
?>
2 to $var, because the string "42" is the initial segment of $subject that consists only of characters contained within "1234567890".
PARAMETERS
o $subject
- The string to examine.
o $mask
- The list of allowable characters.
o $start
- The position in $subject to start searching. If $start is given and is non-negative, then strspn(3) will begin examining $sub-
ject at the $start'th position. For instance, in the string ' abcdef', the character at position 0 is ' a', the character at posi-
tion 2 is ' c', and so forth. If $start is given and is negative, then strspn(3) will begin examining $subject at the $start'th
position from the end of $subject.
o $length
- The length of the segment from $subject to examine. If $length is given and is non-negative, then $subject will be examined for
$length characters after the starting position. If $length is given and is negative, then $subject will be examined from the
starting position up to $length characters from the end of $subject.
RETURN VALUES
Returns the length of the initial segment of $subject which consists entirely of characters in $mask.
EXAMPLES
Example #1
strspn(3) example
<?php
// subject does not start with any characters from mask
var_dump(strspn("foo", "o"));
// examine two characters from subject starting at offset 1
var_dump(strspn("foo", "o", 1, 2));
// examine one character from subject starting at offset 1
var_dump(strspn("foo", "o", 1, 1));
?>
The above example will output:
int(0)int(2)int(1)NOTES
Note
This function is binary-safe.
SEE ALSO strcspn(3).
PHP Documentation Group STRSPN(3)