01-17-2013
7 More Discussions You Might Find Interesting
1. Programming
please refer the following 2 statements...
1)
int i=1,j;
j= i++ + i++;
2) int i=1,j;
j=++i + ++i;
how j becomes 2 and 6 for the above 2 statements
respectively ???
( i guessed j must be 3 and 5)
Somebody define the exact reason please.. :(
... (2 Replies)
Discussion started by: shamal
2 Replies
2. Shell Programming and Scripting
I am trying to strip all leading and trailing spaces of a shell variable using either awk or sed or any other utility, however unscuccessful and need your help.
echo $SH_VAR | command_line Syntax.
The SH_VAR contains embedded spaces which needs to be preserved. I need only for the leading and... (6 Replies)
Discussion started by: jerardfjay
6 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I have a problem where I need to append few spaces(say 10 spaces) for each line in a file whose length is say(100 chars) and others leave as it is.
I tried to find the length of each line and then if the length is say 100 chars then tried to write those lines into another file and use a sed... (17 Replies)
Discussion started by: prathima
17 Replies
4. Shell Programming and Scripting
Hello All,
I am trying to remove all tabspaces and all blankspaces from my file using sed & awk, but not getting proper code. Please help me out.
My file is like this (<b> means one blank space, <t> means one tab space)-
$ cat file
NARESH<b><b><b>KUMAR<t><t>PRADHAN... (3 Replies)
Discussion started by: NARESH1302
3 Replies
5. UNIX for Dummies Questions & Answers
Hello,
I have a script which configures a system,
the configuration is currently manual and error prone.
I am writting a script, which currently uses hard-coded values.
I don't know how to take an IP, e.g. 123.456.789.111, and backslash the periods, so I can pass it to an
`exec perl... (0 Replies)
Discussion started by: Bloke
0 Replies
6. UNIX for Advanced & Expert Users
How to get the file extension having multiple periods
suppose i have a file samplewprk.txt.dat
I need to retrieve txt.dat from the file.
I worked all iam getting is either txt or pyd
Could anyone help me in providing the solution?
Thanks,
in advance (3 Replies)
Discussion started by: chinku
3 Replies
7. Shell Programming and Scripting
Hi,
I have a number of large files (up to 4GB) that I wish to split in 96 parts e.g. one for each 15 minutes of the day. The split can be random so I am using
split -b 42M filename.csv
I want to name each of the resultant files as a distinct 15 minute period of the day e.g. ... (10 Replies)
Discussion started by: ksexton
10 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 whitespace
SYNOPSIS
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)