Need to filter string between specific string in ksh
My argument has data as below.
This is how i run the script:
I wish to get the the filenames between the first IP/hostname and the next IP/hostname only i.e between the first and second IP / Host specified.
Desired Output:
below is what i did so far:
The above prints all file names but I m not able to get the logic of how can I filter filenames between the first IP/Hostname and the SecondOne only ... store it in a variable.
Note: There maybe a case where we do not have a second IP / Hostname in which case we need to get the filename after the first IP / Hostname only.
Tip: we can look for strings starting with hyphen '-' to know if that is a file entry.
I'm using ksh shell on AiX 6.1
Moderator's Comments:
Please stop using QUOTE tags for sample input and output. Use only CODE tags.
Last edited by mohtashims; 10-16-2019 at 02:30 AM..
Hi,
I have logfile like this..
=== 2014-02-09 15:46:59,936 INFO RequestContext - URL: '/eyisp/sc/skins/EY/images/pickers/comboBoxPicker_Over.png', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko': Unsupported with Accept-Encoding header
=== 2015-02-09... (8 Replies)
Hello guys,
I have problem with hpux shell script. I have one big text file that contains like
SOH
bla bla bla
bla bla bla
ETX SOH
bla bla bla
ETX
SOH
bla bla bla
ETX
What I need to do is save first SOH*BLA into file1.txt, save second SOH*BLA into file2.txt and so on.... (17 Replies)
Using ksh, I am using SQLPlus to execute a query with a filter using a string variable.
REPO_DB=DEV1
FOLDER_NM='U_nmalencia'
FOLDER_CHECK=$(sqlplus -s /nolog <<EOF
CONNECT user/pswd_select@${REPO_DB}
set echo off heading off feedback off
select subj_name
from subject
where... (5 Replies)
Hi,
I have log file which rolls out every second which is as this.
HttpGenRequest - -<!--OXi dbPublish--> <created="2014-03-24 23:45:37" lastMsgId="" requestTime="0.0333"> <response request="getOutcomeDetails" code="114" message="Request found no matching data" debug="" provider="undefined"/>... (3 Replies)
Hi folks,
I have a log file with the lines in the below format.
Jul 1 23:00:51 10.212.3.251 SS: %SYS-7-CLI_SCHEDULE: some error occured
I want to split the line based on the " %SYS-7-CLI_SCHEDULE: " value.
The criteria is the should store the word that starts with % i.e., ... (1 Reply)
Hi,
I have a long log file. Out of which I want to filter particular occurrences where APC=4-033-0.
Please help how it can be done.
Input :
+++ ELEMENT 12-05-27 23:15:06 CC 3482 #040185 >
REPT APB TPE=C7NTL SM=22 OPC=4-003-7 APC=4-033-4 inaccessible
END OF REPORT #040185 ++-
... (7 Replies)
I have following string in a variable:
str="sstring garbage adfsdf tab.col1 lkad rjfj tab2.col2 adja tab2.col4 garbage"
I want to filter "word.word" pattern from it. I assume the pattern won't occur in start or end of the string. Output shoud be:
tab.col1 tab2.col2 tab2.col4
Can this be... (7 Replies)
using sed to replace a specific string on a specific line number using variables
this is where i am at
grep -v WARNING output | grep -v spawn | grep -v Passphrase | grep -v Authentication | grep -v '/sbin/tfadmin netguard -C'| grep -v 'NETWORK>' >> output.clean
grep -n Destination... (2 Replies)
I have a file in which there are strings given below:
inode 1138932c(mqsiadm)
inode 1257904c(mqsiadm)
I want to get the nos. only form these.
The o/p should be
1138932
1257904
How to filter this out ?? (11 Replies)