Sponsored Content
Operating Systems Solaris Looking for cooltst.pl[solved] Post 302635305 by System Shock on Friday 4th of May 2012 03:22:58 PM
Old 05-04-2012
Looking for cooltst.pl[solved]

Never mind. Found what I was looking for.

Last edited by System Shock; 05-04-2012 at 04:37 PM..
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[solved] merging two files and writing to another file- solved

i have two files as file1: 1 2 3 file2: a b c and the output should be: file3: 1~a 2~b 3~c (1 Reply)
Discussion started by: mlpathir
1 Replies

2. Emergency UNIX and Linux Support

[Solved] Need help with HP-UX 11.31 LVM!

Hi all, I've created some logical volumes on a non-production server. I was supposed to make the new LV's similar to another LV already on the server. Supposed to be the similar to lvol5 I did everything right except one thing as somebody mentioned. I would like to figure out what I did... (6 Replies)
Discussion started by: zixzix01
6 Replies

3. HP-UX

[Solved] Sendmail again

Hello experts! Can someone help me to configure sendmail v8.9.3 in HP-UX 10.2? I would like to be able to send messages using an external SMTP server. I have configured the DNS - I can ping my smtp server. I dont know how to configure sendmail. In my system there is no file "sendmail.mc"...... (12 Replies)
Discussion started by: wojciech
12 Replies

4. Shell Programming and Scripting

[Solved] sed

sed -e 's/console/raw/g' this command will replace the letter pradeep with rawat what if i want to replace a word like FRIENDS with a space simultaneously from the same file i m replacing pradeep. im doing this sed -e 's/console/raw/g' && sed 's/FRIENDS//g' but i dono why this is not happening. (2 Replies)
Discussion started by: console
2 Replies

5. UNIX for Dummies Questions & Answers

[Solved] Crontab

Hi I need my script to run at 7:30, 7:40, 7:50 & 8:00 AM. Defined like: 30,40,50 7,8 * * * sh myscript.sh But this runs even at 8:30, 8:40, 8:50 - which I don't need.. Please advise. (4 Replies)
Discussion started by: ashokvpp
4 Replies

6. UNIX for Dummies Questions & Answers

[Solved] awk FS

I have a script which uses awk to read from a file seperated with commas, although saved as a .conf file. awk -F, '{print $3}' it is meant to pick up "a label here" (for example) But instead return "a" Problem is that although the command does recognise the comma seperation it still... (1 Reply)
Discussion started by: Pedro72
1 Replies

7. Shell Programming and Scripting

[SOLVED] Using expect

Please help me guys with this, its my first time using expect. heres what i wanted to do. inputs are in red sitescope@server:/opt/HP/SiteScope/bin> ./config_tool.sh -i console This wizard enables you you to change the ports assigned to SiteScope, move configuration data from one SiteScope... (0 Replies)
Discussion started by: ryandegreat25
0 Replies

8. Shell Programming and Scripting

[Solved] Help with condition

I have below code, I am checking on one server where ppp.sh process not running it is perfectly fine, when i am checking the same script on another server where ppp.sh script is running, it is throwing error "too many arguments", how to avoid this. If i will check on server where process running it... (5 Replies)
Discussion started by: learnbash
5 Replies
STREAM_NOTIFICATION_CALLBACK(3) 					 1					   STREAM_NOTIFICATION_CALLBACK(3)

stream_notification_callback - A callback function for the notificationcontext parameter

SYNOPSIS
void stream_notification_callback (int $notification_code, int $severity, string $message, int $message_code, int $bytes_transferred, int $bytes_max) DESCRIPTION
A callable function, used by the notification context parameter, called during an event. Note This is not a real function, only a prototype of how the function should be. PARAMETERS
o $notification_code - One of the STREAM_NOTIFY_* notification constants. o $severity - One of the STREAM_NOTIFY_SEVERITY_* notification constants. o $message - Passed if a descriptive message is available for the event. o $message_code - Passed if a descriptive message code is available for the event. The meaning of this value is dependent on the specific wrapper in use. o $bytes_transferred - If applicable, the $bytes_transferred will be populated. o $bytes_max - If applicable, the $bytes_max will be populated. RETURN VALUES
No value is returned. EXAMPLES
Example #1 stream_notification_callback(3) example <?php function stream_notification_callback($notification_code, $severity, $message, $message_code, $bytes_transferred, $bytes_max) { switch($notification_code) { case STREAM_NOTIFY_RESOLVE: case STREAM_NOTIFY_AUTH_REQUIRED: case STREAM_NOTIFY_COMPLETED: case STREAM_NOTIFY_FAILURE: case STREAM_NOTIFY_AUTH_RESULT: var_dump($notification_code, $severity, $message, $message_code, $bytes_transferred, $bytes_max); /* Ignore */ break; case STREAM_NOTIFY_REDIRECTED: echo "Being redirected to: ", $message; break; case STREAM_NOTIFY_CONNECT: echo "Connected..."; break; case STREAM_NOTIFY_FILE_SIZE_IS: echo "Got the filesize: ", $bytes_max; break; case STREAM_NOTIFY_MIME_TYPE_IS: echo "Found the mime-type: ", $message; break; case STREAM_NOTIFY_PROGRESS: echo "Made some progress, downloaded ", $bytes_transferred, " so far"; break; } echo " "; } $ctx = stream_context_create(); stream_context_set_params($ctx, array("notification" => "stream_notification_callback")); file_get_contents("http://php.net/contact", false, $ctx); ?> The above example will output something similar to: Connected... Found the mime-type: text/html; charset=utf-8 Being redirected to: http://no.php.net/contact Connected... Got the filesize: 0 Found the mime-type: text/html; charset=utf-8 Being redirected to: http://no.php.net/contact.php Connected... Got the filesize: 4589 Found the mime-type: text/html;charset=utf-8 Made some progress, downloaded 0 so far Made some progress, downloaded 0 so far Made some progress, downloaded 0 so far Made some progress, downloaded 1440 so far Made some progress, downloaded 2880 so far Made some progress, downloaded 4320 so far Made some progress, downloaded 5760 so far Made some progress, downloaded 6381 so far Made some progress, downloaded 7002 so far Example #2 Simple progressbar for commandline download client <?php function usage($argv) { echo "Usage: "; printf(" php %s <http://example.com/file> <localfile> ", $argv[0]); exit(1); } function stream_notification_callback($notification_code, $severity, $message, $message_code, $bytes_transferred, $bytes_max) { static $filesize = null; switch($notification_code) { case STREAM_NOTIFY_RESOLVE: case STREAM_NOTIFY_AUTH_REQUIRED: case STREAM_NOTIFY_COMPLETED: case STREAM_NOTIFY_FAILURE: case STREAM_NOTIFY_AUTH_RESULT: /* Ignore */ break; case STREAM_NOTIFY_REDIRECTED: echo "Being redirected to: ", $message, " "; break; case STREAM_NOTIFY_CONNECT: echo "Connected... "; break; case STREAM_NOTIFY_FILE_SIZE_IS: $filesize = $bytes_max; echo "Filesize: ", $filesize, " "; break; case STREAM_NOTIFY_MIME_TYPE_IS: echo "Mime-type: ", $message, " "; break; case STREAM_NOTIFY_PROGRESS: if ($bytes_transferred > 0) { if (!isset($filesize)) { printf(" Unknown filesize.. %2d kb done..", $bytes_transferred/1024); } else { $length = (int)(($bytes_transferred/$filesize)*100); printf(" [%-100s] %d%% (%2d/%2d kb)", str_repeat("=", $length). ">", $length, ($bytes_transferred/1024), $filesize/1024); } } break; } } isset($argv[1], $argv[2]) or usage($argv); $ctx = stream_context_create(); stream_context_set_params($ctx, array("notification" => "stream_notification_callback")); $fp = fopen($argv[1], "r", false, $ctx); if (is_resource($fp) && file_put_contents($argv[2], $fp)) { echo " Done! "; exit(0); } $err = error_get_last(); echo " Errrrrorr.. ", $err["message"], " "; exit(1); ?> Executing the example above with: php -n fetch.php http://no2.php.net/get/php-5-LATEST.tar.bz2/from/this/mirror php-latest.tar.bz2 will output something similar too: Connected... Mime-type: text/html; charset=utf-8 Being redirected to: http://no2.php.net/distributions/php-5.2.5.tar.bz2 Connected... Filesize: 7773024 Mime-type: application/octet-stream [========================================> ] 40% (3076/7590 kb) SEE ALSO
"Context parameters". PHP Documentation Group STREAM_NOTIFICATION_CALLBACK(3)
All times are GMT -4. The time now is 02:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy