To prevent injection, I want to exit the attached routine if a semi-colon is in the input string. I am using gcc as the compiler.
#include<stdio.h>
#include<stdlib.h>
int sysrun(char *command) {
int num;
char str;
char process = "/xxxx/xxxx/xxxxx/xxxxx/xxxxxx2unix.sh ";
num=0;... (10 Replies)
Hi all,
I have the following script which I use to chek the output of jobs submitted to a PBS server.
#!/bin/sh
#
#recover.sh
#
check()
{
echo "Do you want to proceed?"
read answer
if ; then
echo "... proceeding ..."
else
echo "--------- Aborting -----------"... (0 Replies)
Hello everyone
Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried
sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
logs:
"/home/abc/public_html/index.php"
"/home/abc/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
how to use "cut" or "awk" or "sed" to get the following result:
abc
abc
xyz
xyz
xyz (8 Replies)
I came across and unexpected behavior with redirections in tcsh. I know, csh is not best for redirections, but I'd like to understand what is happening here.
I have following script (called out_to_streams.csh):
#!/bin/tcsh -f
echo Redirected to STDOUT > /dev/stdout
echo Redirected to... (2 Replies)
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)
Hello.
Following recommendations for one of my threads, this is working perfectly :
#!/bin/bash
CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" )
Now I need a grep success for some thing like :
#!/bin/bash
CNT=$( grep -c -e "some text_1... (4 Replies)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Hi,
I am using awk here.
Inside an awk script, I have a variable which contains a very long XML data in string format (500kb).
I want to pass this data (as argument) to curl command using system function.
But getting Too many arguments error due to length of string data(payloadBlock).
I... (4 Replies)
Dear Ladies & Gents,
I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out:
for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies
LEARN ABOUT PHP
php_strip_whitespace
PHP_STRIP_WHITESPACE(3) 1 PHP_STRIP_WHITESPACE(3)php_strip_whitespace - Return source with stripped comments and whitespaceSYNOPSIS
string php_strip_whitespace (string $filename)
DESCRIPTION
Returns the PHP source code in $filename with PHP comments and whitespace removed. This may be useful for determining the amount of actual
code in your scripts compared with the amount of comments. This is similar to using php -w from the commandline.
PARAMETERS
o $filename
- Path to the PHP file.
RETURN VALUES
The stripped source code will be returned on success, or an empty string on failure.
Note
This function works as described as of PHP 5.0.1. Before this it would only return an empty string. For more information on this
bug and its prior behavior, see bug report #29606.
EXAMPLES
Example #1
php_strip_whitespace(3) example
<?php
// PHP comment here
/*
* Another PHP comment
*/
echo php_strip_whitespace(__FILE__);
// Newlines are considered whitespace, and are removed too:
do_nothing();
?>
The above example will output:
<?php
echo php_strip_whitespace(__FILE__); do_nothing(); ?>
Notice the PHP comments are gone, as are the whitespace and newline after the first echo statement.
PHP Documentation Group PHP_STRIP_WHITESPACE(3)