Search : in
By :

Shell script

Last answer on Dec 5, 2008 3:46:35 pm GMT lg123, on Apr 11, 2008 7:53:13 am BST 
 Report this message to moderators

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?

Best answers for « shell script » in :
[Ubuntu] Executing a script at startup and shutdown Show[Ubuntu] Executing a script at startup and shutdown To execute a script at startup To execute a script at shutdown To execute a script at startup of Ubuntu Edit /etc/rc.local and add your commands. The script must always end with...
Changing password via a script ShowChanging password via a script Method 1: passwd Method 2: chpasswd Method 1: passwd Conventionally the command use to change password on Linux based system is passwd , the option related to this command is –stdin ,an this is all...
Replacing Variables in Bash/shell ShowReplacing Variables in Bash/shell Intro: Expression:Defininition Intro: First of all make sure that you the variable is defined before replacing it, or in other cases determine that it is not empty, and to initialize with a default...
Download SSH Secure Shell ShowSSH secure shell for workstations is a flexible client SSH allowing to connect in a secured way to remote applications. http://www.commentcamarche.net/faq/images/NHc6wz5jOYBhPXTis.png
Download Vista Live Shell Pack - Pink ShowIf you want to have Vista on your computer but your shape is not rather powerful or if simply you cannot have to be paid this version yet? Then resolution is to change the appearance of your good old XP. Vista Live Shell Pack is a topic of office...
UNIX system - The shell ShowIntroduction to the shell The command interpreter is the interface between the user and the operating system, hence its name "shell". The shell therefore acts as an intermediary between the operating system and the user using command lines...
Using Telnet ShowIntroduction to Telnet Telnet is a protocol for emulating a remote terminal, which means that it can be used to run commands entered on a keyboard at a remote machine. The tool Telnet is an implementation of the Telnet protocol, which means that it...
Environment variables ShowEnvironment variables An environment variable is a dynamic value loaded into the memory that can be used by several processes operating simultaneously. On most operating systems, the location of some libraries or of the main system executables may...

1

jipicy, on Apr 13, 2008 7:49:27 am BST
  • +1

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

3

 your id include, on Nov 24, 2008 2:42:33 pm GMT
  • +1

Thanks this right ?

Reply to your id include