Sponsored Content
Top Forums Shell Programming and Scripting Need to get word after a specific word Post 302965390 by admin_db on Thursday 28th of January 2016 06:33:31 AM
Old 01-28-2016
Thanks RudiC and Ravinder ! Both script are working fine.

Now,I have task as follows :
I get standby tnsentry from primary database like I get destination from below query:

Code:
SQL> select DESTINATION from v$archive_dest where target='REMOTE';

DESTINATION
------------------------------
ora11gb

Then I would extract hostname from tnsping and will transfer passwordfile to that host from primary.

Best regards,
Vishal
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to replace a specific word in specific column?

Hi My orginal file is like (100s of lines) id host ip location remarks 1 host1 ip1 - xxx 2 host2 ip2 - xxx 3 host3 ip3 - xxx -- -- 9 host9 ip9 - xxx I have a ref file like host1 location1 host2 location2 host3 location3 -- --... (6 Replies)
Discussion started by: ./hari.sh
6 Replies

2. Shell Programming and Scripting

Grep out specific word and only that word

ok, so this is proving to be kind of difficult even though it should not be. say for instance I want to grep out ONLY the word fkafal from the below output, how do I do it? echo ajfjf fjfjf iafjga fkafal foeref afoafahfia | grep -w "fkafal" If i run the above command, i get back all the... (4 Replies)
Discussion started by: SkySmart
4 Replies

3. UNIX for Dummies Questions & Answers

How to print line starts with specific word and contains specific word using sed?

Hi, I have gone through may posts and dint find exact solution for my requirement. I have file which consists below data and same file have lot of other data. <MAPPING DESCRIPTION ='' ISVALID ='YES' NAME='m_TASK_UPDATE' OBJECTVERSION ='1'> <MAPPING DESCRIPTION ='' ISVALID ='NO'... (11 Replies)
Discussion started by: tmalik79
11 Replies

4. UNIX for Dummies Questions & Answers

Find EXACT word in files, just the word: no prefix, no suffix, no 'similar', just the word

I have a file that has the words I want to find in other files (but lets say I just want to find my words in a single file). Those words are IDs, so if my word is ZZZ4, outputs like aaZZZ4, ZZZ4bb, aaZZZ4bb, ZZ4, ZZZ, ZyZ4, ZZZ4.8 (or anything like that) WON'T BE USEFUL. I need the whole word... (6 Replies)
Discussion started by: chicchan
6 Replies

5. Shell Programming and Scripting

Fetch entries in front of specific word till next word

Hi all I have following file which I have to edit for research purpose file:///tmp/moz-screenshot.png body, div, table, thead, tbody, tfoot, tr, th, td, p { font-family: &quot;Liberation Sans&quot;; font-size: x-small; } Drug: KRP-104 QD Drug: Placebo Drug: Metformin|Drug:... (15 Replies)
Discussion started by: Priyanka Chopra
15 Replies

6. UNIX for Dummies Questions & Answers

Quick UNIX command to display specific lines in the middle of a file from/to specific word

This could be a really dummy question. I have a log text file. What unix command to extract line from specific string to another specific string. Is it something similar to?: more +/"string" file_name Thanks (4 Replies)
Discussion started by: aku
4 Replies

7. Shell Programming and Scripting

Need a word which just comes next to after grep of a specific word

Hi, Below is an example : ST1 PREF: int1 AVAIL: int2 ST2 PREF :int1 AVAIL: int2 I need int1 to come in preferred variable while programming and int2 in available variable Please help me doing so Best regards, Vishal (10 Replies)
Discussion started by: Vishal_dba
10 Replies

8. Shell Programming and Scripting

How to print multiple specific column after a specific word?

Hello.... Pls help me (and sorry my english) :) So I have a file (test.txt) with 1 long line.... for example: isgc jsfh udgf osff 8462 error iwzr 653 idchisfb isfbisfb sihfjfeb isfhsi gcz eifh How to print after the "error" word the 2nd 4th 5th and 7th word?? output well be: 653 isfbisfb... (2 Replies)
Discussion started by: marvinandco
2 Replies

9. Shell Programming and Scripting

Search for a specific word and print only the word from the input file

Hi, I have a sample file as shown below, I am looking for sed or any command which prints the complete word only from the input file. Ex: $ cat "sample.log" I am searching for a word which is present in this file We can do a pattern search using grep but I need to cut only the word which... (1 Reply)
Discussion started by: mohan_kumarcs
1 Replies

10. UNIX for Beginners Questions & Answers

How to search for a word in column header that fully matches the word not partially in awk?

I have a multicolumn text file with header in the first row like this The headers are stored in an array called . which contains I want to search for each elements of this array from that multicolumn text file. And I am using this awk approach for ii in ${hdr} do gawk -vcol="$ii" -F... (1 Reply)
Discussion started by: Atta
1 Replies
mailutil(1)						      General Commands Manual						       mailutil(1)

NAME
mailutil - mail utility program SYNTAX
mailutil command [switches] [arguments] All commands accept the -d, -v, and -u switches in addition to any command-specific switches. mailutil check [MAILBOX] mailutil create MAILBOX mailutil delete MAILBOX mailutil rename SOURCE DESTINATION mailutil copy [-rw] [-kw] [-ig] SOURCE DESTINATION mailutil move [-rw] [-kw] [-ig] SOURCE DESTINATION mailutil append [-rw] [-kw] [-ig] SOURCE DESTINATION mailutil appenddelete [-rw] [-kw] [-ig] SOURCE DESTINATION mailutil prune MAILBOX CRITERIA mailutil transfer [-m mode] [-rw] [-kw] [-ig] SOURCE DESTINATION DESCRIPTION
mailutil replaces the old chkmail, imapcopy, imapmove, imapxfer, mbxcopy, mbxcreat, and mbxcvt programs. mailutil check determines whether new mail exists in the given mailbox (the default is INBOX). The number of new messages is defined as the number of messages that have "Recent" status set. If the mailbox contains no new messages, mailutil check will indicate that no new mail is present; otherwise, it will report the number of new messages. In either case, it will also indicate the canonical form of the name of the mailbox. mailutil create creates a new mailbox with the given name. The mailbox name must not already exist. A mailbox can be created in a particular format by prefixing the name with #driver. followed by the format name and a / character. For example, the command mailutil create #driver.mbx/junkmail will create a new mailbox named "junkmail" in mbx format. mailutil delete deletes an existing mailbox with the given name. mailutil rename renames an existing mailbox to a new name (which must not already exist). This only works if the old and new names are in the same mail store. A more general means to rename a mailbox is to do a mailutil copy of the old name to the new name, followed by a mailutil delete of the old name. mailutil copy creates a new mailbox and copies messages from the old mailbox to the new mailbox. As in mailutil create a mailbox format can be specified with the new mailbox. For example, the command mailutil copy INBOX #driver.mbx/INBOX will copy messages from your existing INBOX to an mbx-format INBOX. mailutil move is similar to mailutil copy but in addition will also remove (delete and expunge) the messages from the old mailbox after copying them to the new mailbox. mailutil append and mailutil appenddelete are similar to mailutil copy and mailutil move respectively except that they do not create the destination mailbox. mailutil prune prunes the mailbox of messages which match certain criteria, which are in the form of IMAP2 (RFC 1176) SEARCH arguments. For example, the command. mailutil prune INBOX "before 1-jan-2004" will delete and expunge all messages written before January 1, 2004. Note that mailutil implements pruning by deleting the matching messages, and then expunging the mailbox. Consequently, mailutil will also expunge any messages which were deleted at the time of the pruning. mailutil transfer copies an entire hierarchy of mailboxes from the named source to the named destination. Mailboxes are created on the destination as needed. Any error in copying messages will cause the transfer to stop. Normally, any error in creation will cause the transfer to stop. However, if -m MODE or -merge MODE is specified, a merging transfer is performed. The MODE argument indicats the type of merge: -m[erge] prompt indicates that the user should be asked for an alternative name to create. If creating the new name fails, the user will be asked again. -m[erge] append indicates that it's alright to copy the messages into an existing mailbox with that name. If the mailbox does not exist, the user will be prompted for an alternative name. -m[erge] suffix=XXXX where XXXX is any string, indicates that an alternative name should be built by appending the given suffix to the name. It that alternative name can't be created, then the user will be prompted for an alternative name. The source hierarchy consists of all mailboxes which start with the given source name. With the exception of a remote system specification (within "{}" braces), the source name is used as the name of the destination. The destination hierarchy is a prefix applied to any new names being created. For example, mailutil transfer foo bar will copy all mailboxes with names beginning with "foo" to names beginning with "bar" (hence "foobar" will be copied to "barfoobar"). Similarly, mailutil transfer "{imap.foo.com}" "{imap.bar.com}old/" will copy all mailboxes from the imap.foo.com IMAP server to equivalent names starting with "old/" on the imap.bar.com IMAP server. FLAGS
The -d or -debug flag prints full debugging telemetry including protocol operations. The -v or -verbose flag prints verbose (non-error) telemetry. The -u USERID or -user USERID switch attempts to become the indicated user. This is for the benefit of system administrators who want to do mailutil operations on a userid that does not normally have shell access. The -rw or -rwcopy flag causes the source mailbox to be open in readwrite mode rather than readonly mode. Normally, mailutil tries to use readonly mode to avoid altering any flags in the source mailbox, but some mailbox types, e.g. POP3, can't be open in readonly mode. The -kw or -kwcopy flag causes the keywords of the source mailbox to be created in the destination mailbox. Normally, mailutil does not create keywords in the destination mailbox so only those keywords that are already defined in the destination mailbox will be preserved. Note that some IMAP servers may automatically create keywords, so this flag may not be necessary. The -ig or -ignore flag causes the keywords of the source mailbox to be ignored completely and no attempt is made to copy them to the destination mailbox. The -ig[nore] and -kw[copy] flags are mutually exclusive. ARGUMENTS
The arguments are standard c-client mailbox names. A variety of mailbox name formats and types of mailboxes are supported by c-client; examples of the most common forms of names are: Name Meaning INBOX primary incoming mail folder on the local system archive/tx-project mail folder named "tx-project" in "archive" subdirectory of local filesystem home directory {imapserver.foo.com}INBOX primary incoming mail folder on IMAP server system "imapserver.foo.com" {imapserver.foo.com}archive/tx-project mail folder named "tx-project" in "archive" subdirectory on IMAP server system "imapserver.foo.com" #news.comp.mail.misc newsgroup "comp.mail.misc" on local filesystem {newserver.foo.com/nntp}comp.mail.misc newsgroup "comp.mail.misc" on NNTP server system "newserver.foo.com" {popserver.foo.com/pop3} mail folder on POP3 server system "popserver.foo.com" See your system manager for more information about the types of mailboxes which are available on your system. RESTRICTIONS
You must surround a {host}mailbox argument with quotation marks if you run mailutil from csh(1) or another shell for which braces have special meaning. You must surround a #driver.format/mailbox argument with quotation marks if you run mailutil from a shell in which "#" is the comment character. AUTHOR
Mark Crispin, MRC@Washington.EDU March 3, 2008 mailutil(1)
All times are GMT -4. The time now is 03:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy