Artificial intelligent assistant

Linux Bash Script Parsing Unknown output with Known Delimeter I'm writing a recon shell script and I would like to parse the output of odat sidguesser so i can save only the found SID's into a file or variable. For example. I have the string; [+] SIDs found on the 10.10.10.82:1521 server: XE,XEXDB What I'm trying to do is parse this output so only XE,XEXDB remains so I can store it in a file or variable to further enumerate / run odat passwordguesser with the SID. How can i use sed or awk or grep etc... to get all valid SID's without knowing how many will be found? I'm able to get the SID's by doing, cat oracle-sid.txt | grep "server:" | rev | cut -d " " -f 1 | rev This works for my purposes since XE,XEXDB is all considered 1 string and i can write more logic to loop through it etc.... However, In the case where the SID's were separated by spaces, How would one go about parsing every SID or string after the word/delimeter, "server:" ?

$ sed -n -e 's/^.*server: //p' oracle-sid.txt
XE,XEXDB


On matching lines, the `sed` script deletes everything from the beginning of the line to "server: " (including the trailing space), and then prints the modified line. Non-matching lines are ignored (i.e. not printed).

If you want to keep the IP address and port as well:


$ sed -e -e 's/^.* \([0-9.:]\+\) server: /\1\t/p' oracle-sid.txt
10.10.10.82:1521 XE,XEXDB


This will do the same as the first version, but include the IP:Port and a TAB character.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy c828e9d16dc32df1407c2e385ea3a719