Shell script

Closed
lg123 - Apr 11, 2008 at 02:53 AM
 your id include - Nov 24, 2008 at 09:42 AM
Hi

I have a text file named information.txt which contains information about Oracle Instances, I want to fetch data's from that text file and want to display an output using shell script.
i.e. when I execute that shell script ,it should read all data's from information.txt and display an output like below.
I willl try explain with an example...
Say i have a file "file" containing..
Instance : DB1,windows
Instance : DB2,unix
Instance : DB3,solaris
Instance : DB4,unix
;;;;;;;;etc


so... my shell script should read the file and display output as
DB1,windows,OK
DB2,unix,OK
DB3,solaris,OK
DB4,unix, OK
;;;;; etc

How do I write this script? Can you tell me ..which command wud be appropriate?
Related:

1 response

jipicy Posts 40842 Registration date Wednesday August 27, 2003 Status Moderator Last seen August 10, 2020 17
Apr 13, 2008 at 02:49 AM
Hi,

Try this :
$ cat plop
Instance : DB1,windows
Instance : DB2,unix
Instance : DB3,solaris
Instance : DB4,unix

$ sed 's/.* : \(.*\)/\1,OK/' plop 
DB1,windows,OK
DB2,unix,OK
DB3,solaris,OK
DB4,unix,OK
;-))
0
your id include
Nov 24, 2008 at 09:42 AM
thanks this right ?
0