LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Copy line from file and write it to another file (https://www.linuxquestions.org/questions/linux-newbie-8/copy-line-from-file-and-write-it-to-another-file-680412/)

shokeer 11-01-2008 02:02 AM

Copy line from file and write it to another file
 
Hi All,
Thank you for helping according to the last question and i want to ask another two quesion as the following:-

1- I have a tnsnames.ora contains this text (REP_SHOKEEROR12_ORAAPPR2. =)
and i want to search on this line & copy this line to another file called tnsnames.log.

2- I want to update table from shell script command.

Thanks,

Ahmed Shokeer

unSpawn 11-01-2008 05:47 AM

Quote:

Originally Posted by shokeer (Post 3327958)
i want to search on this line & copy this line to another file

You'll want Rute or some other generic "basic commands" tutorial to read: 'grep name_of_infile '(REP_SHOKEEROR12_ORAAPPR2. =)' >> name_of_outfile'.


Quote:

Originally Posted by shokeer (Post 3327958)
I want to update table from shell script command.

So whats the actual and full command to "update table"?

pixellany 11-01-2008 07:54 AM

I think you can also use SED to grab a line and write it to a file. You need to be clear whether you want to append the line to the file (as in the example above) or to replace the contents of the file with the new line.
Excellent SED tutorial here:
http://www.grymoire.com/Unix/Sed.html

Quote:

2- I want to update table from shell script command.
You will have to explain this one....What kind of table?...Update with what?


All times are GMT -5. The time now is 12:48 AM.