Hi All,
I have multiple functions in my script and I'm trying to capture stdout from some of them, but I also do some error checking in them (in the functions that output something to their stdout that needs capturing) and I need to be able to end the entire script with an error message.
... (2 Replies)
hey guys i need some help here i am trying to do a bash shell script to get a parent PID and then search for all childs and kill them all without killing the parent, my problem is in the loop it seems that i dont know how to make a if statment inside a while statment it does not give me what i... (5 Replies)
Hi,
I am using awk statement to extract data from a file and write a new file with certain columns rearranged and few hard coded values added to new file.
Now i need to add a column with sysdate. can i do that inside the awk print statement?
Now:
nawk ' /^3/ BEGIN {FS=","}... (2 Replies)
Hello,
I am using shell scripting and I am recieving odd results from my if statement
if
I want it to enter the loop only if L1 is equal to zero and one of the other criteria are filled, however it is entering at other times as well. What can i do to fix this? i tried seperating it... (6 Replies)
Hi,
I have problem with the following code. My IF block is not executed. And I see "syntax error near unexpected token `)'" error for line "EOF" in the stats_function().
but when I comment the IF block I don't see this error.
Kindly help me with this issue.
clean_function()
{... (10 Replies)
I need to Write a shell script that allows some system-administration tasks to be preformed automatically from a menu-driven interface. with automated following tasks:
Copy directory tree
Delete files or directories
Output Information (this part is done )
*Copy directory tree
The “Copy... (2 Replies)
I was trying to write multiple conditions inside the if statement but its not working.
export VAR_NM=abc.txt
export CURR_DT=20131011
export PREV_DT=20131012
if &&
then
echo "Yes"
else
echo "NO"
fi
It should return Yes but returning NO always.Appreciate any help. (3 Replies)
Hello
can you please help me with below script which is meant to delete clients from multiple netbackup policies
I want to run a command insdie awk statement
apparelnlty this script is not working for me
for i in $( cat clients_list)
do
bppllist -byclient $i | awk... (6 Replies)
Hi,
This query is a part of a much more lengthy script.
I wish to look for all the files in a folder named "data" which in this case has two files i.e. plan.war and agent.properties. For all the files found under data I wish to ask the user as to where they wish copy the files to.
Below,... (14 Replies)
Discussion started by: mohtashims
14 Replies
LEARN ABOUT PHP
stream_filter_prepend
STREAM_FILTER_PREPEND(3) 1 STREAM_FILTER_PREPEND(3)stream_filter_prepend - Attach a filter to a streamSYNOPSIS
resource stream_filter_prepend (resource $stream, string $filtername, [int $read_write], [mixed $params])
DESCRIPTION
Adds $filtername to the list of filters attached to $stream.
PARAMETERS
o $stream
- The target stream.
o $filtername
- The filter name.
o $read_write
- By default, stream_filter_prepend(3) will attach the filter to the read filter chain if the file was opened for reading (i.e.
File Mode: r, and/or +). The filter will also be attached to the write filter chain if the file was opened for writing (i.e. File
Mode: w, a, and/or +). STREAM_FILTER_READ, STREAM_FILTER_WRITE, and/or STREAM_FILTER_ALL can also be passed to the $read_write
parameter to override this behavior. See stream_filter_append(3) for an example of using this parameter.
o $params
- This filter will be added with the specified $params to the beginning of the list and will therefore be called first during
stream operations. To add a filter to the end of the list, use stream_filter_append(3).
RETURN VALUES
Returns a resource which can be used to refer to this filter instance during a call to stream_filter_remove(3).
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.1.0 | |
| | |
| | Prior to PHP 5.1.0, this function returns TRUE |
| | on success or FALSE on failure. |
| | |
+--------+---------------------------------------------------+
NOTES
Note
When using custom (user) filters
stream_filter_register(3) must be called first in order to register the desired user filter to $filtername.
Note
Stream data is read from resources (both local and remote) in chunks, with any unconsumed data kept in internal buffers. When a new
filter is prepended to a stream, data in the internal buffers, which has already been processed through other filters will not be
reprocessed through the new filter at that time. This differs from the behavior of stream_filter_append(3).
Note
When a filter is added for read and write, two instances of the filter are created. stream_filter_prepend(3) must be called twice
with STREAM_FILTER_READ and STREAM_FILTER_WRITE to get both filter resources.
SEE ALSO stream_filter_register(3), stream_filter_append(3).
PHP Documentation Group STREAM_FILTER_PREPEND(3)