Sponsored Content
Full Discussion: Unix script required
Top Forums Shell Programming and Scripting Unix script required Post 302531479 by karthikkasarla on Friday 17th of June 2011 02:11:25 AM
Old 06-17-2011
Unix script required

I have a file 123.txt which is

aasaasas=1
bsasasasasa=2
sawqas=3

I want my output to be
1
2
3


I am new to scripting can some1 help me out.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

UNIX PATH info required PLEASE HELP (I'm new to unix)

I need to know how to enter a unix path in a cgi script for a guest book: example: My URL is http://www.kitachi.info I have an html file in the main folder on my site, the file is called : gbook.html what would the correct unix path for this file be ??? the part of the script... (1 Reply)
Discussion started by: akitachi
1 Replies

2. Programming

UNIX Internals, Help required...

I know UNIX user level commands, shell scripts. But i have no idea about kernel level programming and networking. I know the terms semaphore,IPC,socket programming. But i don't know in details what are these. I need to know the following. 1. Unix kernel level programming. 2. Unix Internals. 3.... (4 Replies)
Discussion started by: digdarshan
4 Replies

3. UNIX for Advanced & Expert Users

help required in unix command/script

Hi All, Please help me in writting the script File contains: ========= 11424444, <basicpage> jfalfksf <dateofbirth>10/02/2005</dateofbrith> jkaklgja lg'd .... 11423224444, <basicpage> jfalfksf <dateofbirth>11/02/2005</dateofbrith> jkaklgja lg'd 11433523224444, <basicpage>... (1 Reply)
Discussion started by: thaduka
1 Replies

4. Shell Programming and Scripting

Help Required: To run the attached UNIX script

Hi, This Script contains update statements and running without error. But the update result is not getting reflected in the database. i.e may be Script fails to connect to the database. it would be of great help if you could figure out the problem. Thanks, Shruti Script follows here:... (5 Replies)
Discussion started by: Shrutiduggal
5 Replies

5. UNIX for Advanced & Expert Users

Help required regarding Unix Signal

It is required to trap the signal send to a daemon process before rebooting a unix server. Suppose a script abc.ksh is running in the server as daemon. Before rebooting the server, the unix admin kills all the daemon processes. It is not known to me how admin kills the processes; I mean by which... (9 Replies)
Discussion started by: k_bijitesh
9 Replies

6. Shell Programming and Scripting

Getting required fields from a test file in required fromat in unix

My data is something like shown below. date1 date2 aaa bbbb ccccc date3 date4 dddd eeeeeee ffffffffff ggggg hh I want the output like this date1date2 aaa eeeeee I serached in the forum but didn't find the exact matching solution. Please help. (7 Replies)
Discussion started by: rdhanek
7 Replies

7. Shell Programming and Scripting

Help required on basic Unix Bourne Shell Script

Howdy People :), I'm a newbie & its my first question here. I've started learning Unix Bourne Shell scripting recently and struggling already :p Can someone PLEASE help me with the following problem. Somehow my script is not working. Display an initial prompt of the form: Welcome to... (1 Reply)
Discussion started by: methopoth
1 Replies

8. Shell Programming and Scripting

How to send email using shell script in UNIX, Is any environment setup required in Mac OS X ?

Hi All, I am using Mac OS X (Leopard OS). I am very new to UNIX. My requirement is that, by running a shell script, I create a log file. So I have to send a mail having that log file attached. What I tried to do is, I simply tried to check,whether this direct command works or not. So I... (2 Replies)
Discussion started by: Afreen
2 Replies

9. Shell Programming and Scripting

UNIX Script required for count the records in table

Hi Friends, I looking for the script for the count of the records in table. and then it's containg the zero records then should get abort. and should notify us through mail. Can you please help me out in this area i am lacking. (5 Replies)
Discussion started by: victory
5 Replies

10. UNIX for Beginners Questions & Answers

UNIX shell script required to read two columns from xml

Hello All, I am new to unix scripting. I need to read FROMINSTANCE, FROMFIELD from below XML code and need to write a script for insert into SQ_EPIC values( "DID", "PROJECT_NAME") Select DID, PROJECT_NAME from EPIC<CONNECTOR TOINSTANCETYPE="Source Qualifier" TOINSTANCE="SQ_EPIC" TOFIELD="DID"... (7 Replies)
Discussion started by: sekhar.lsb
7 Replies
STREAM_FILTER_REGISTER(3)						 1						 STREAM_FILTER_REGISTER(3)

stream_filter_register - Register a user defined stream filter

SYNOPSIS
bool stream_filter_register (string $filtername, string $classname) DESCRIPTION
stream_filter_register(3) allows you to implement your own filter on any registered stream used with all the other filesystem functions (such as fopen(3), fread(3) etc.). PARAMETERS
o $filtername - The filter name to be registered. o $classname - To implement a filter, you need to define a class as an extension of php_user_filter with a number of member functions. When performing read/write operations on the stream to which your filter is attached, PHP will pass the data through your filter (and any other filters attached to that stream) so that the data may be modified as desired. You must implement the methods exactly as described in php_user_filter - doing otherwise will lead to undefined behaviour. RETURN VALUES
Returns TRUE on success or FALSE on failure. stream_filter_register(3) will return FALSE if the $filtername is already defined. EXAMPLES
Example #1 Filter for capitalizing characters on foo-bar.txt stream The example below implements a filter named strtoupper on the foo-bar.txt stream which will capitalize all letter characters writ- ten to/read from that stream. <?php /* Define our filter class */ class strtoupper_filter extends php_user_filter { function filter($in, $out, &$consumed, $closing) { while ($bucket = stream_bucket_make_writeable($in)) { $bucket->data = strtoupper($bucket->data); $consumed += $bucket->datalen; stream_bucket_append($out, $bucket); } return PSFS_PASS_ON; } } /* Register our filter with PHP */ stream_filter_register("strtoupper", "strtoupper_filter") or die("Failed to register filter"); $fp = fopen("foo-bar.txt", "w"); /* Attach the registered filter to the stream just opened */ stream_filter_append($fp, "strtoupper"); fwrite($fp, "Line1 "); fwrite($fp, "Word - 2 "); fwrite($fp, "Easy As 123 "); fclose($fp); /* Read the contents back out */ readfile("foo-bar.txt"); ?> The above example will output: LINE1 WORD - 2 EASY AS 123 Example #2 Registering a generic filter class to match multiple filter names. <?php /* Define our filter class */ class string_filter extends php_user_filter { var $mode; function filter($in, $out, &$consumed, $closing) { while ($bucket = stream_bucket_make_writeable($in)) { if ($this->mode == 1) { $bucket->data = strtoupper($bucket->data); } elseif ($this->mode == 0) { $bucket->data = strtolower($bucket->data); } $consumed += $bucket->datalen; stream_bucket_append($out, $bucket); } return PSFS_PASS_ON; } function onCreate() { if ($this->filtername == 'str.toupper') { $this->mode = 1; } elseif ($this->filtername == 'str.tolower') { $this->mode = 0; } else { /* Some other str.* filter was asked for, report failure so that PHP will keep looking */ return false; } return true; } } /* Register our filter with PHP */ stream_filter_register("str.*", "string_filter") or die("Failed to register filter"); $fp = fopen("foo-bar.txt", "w"); /* Attach the registered filter to the stream just opened We could alternately bind to str.tolower here */ stream_filter_append($fp, "str.toupper"); fwrite($fp, "Line1 "); fwrite($fp, "Word - 2 "); fwrite($fp, "Easy As 123 "); fclose($fp); /* Read the contents back out */ readfile("foo-bar.txt"); ?> The above example will output: LINE1 WORD - 2 EASY AS 123 SEE ALSO
stream_wrapper_register(3), stream_filter_append(3), stream_filter_prepend(3). PHP Documentation Group STREAM_FILTER_REGISTER(3)
All times are GMT -4. The time now is 02:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy