rss
Search : in
By : Relevance Date Username
Statut : Not resolved

Shell script

Posté par lg123, le Friday April 11, 2008 07:53:13 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?
Reply to lg123  Report this message to moderators Go to last message

1


  • This message seems useful, vote!
  • Report this message to moderators
 jipicy, on Sunday April 13, 2008 07:49:27 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
;-))
JP - �leveur de pingouins -
Faites un geste pour l'environnement, fermez vos fen�tres et adoptez un manchot.
Reply to jipicy
Tips & Tricks relevant found in the knowledge base
26/02 15h05How to make a video clip ?Video
More tricks on « shell script »
Software found in the relevant downloads
Download Avast! 4 Familial 4.8Avast! 4 Familial - avast! 4 Home Edition is a complete and free antivirus solution, fully able to find computer viruses, to create and check...Category: Antivirus
License: Freeware/gratuit
Download MediaCoder 0.6.1.4111MediaCoder - MediaCoder is a free universal batch media transcoder, which nicely integrates most popular audio/video codecs and tools...Category: Video editing
License: Open Source
Download AxCrypt 1.6.4.4AxCrypt - AxCrypt is the leading open source file encryption software for Windows. It integrates seamlessly with Windows to encrypt,...Category: Encryption
License: Open Source
More freeware about « shell script »