Need to filter string between specific string in ksh

My argument has data as below.

10.9.9.85
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr5.scr 127869538
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr56scr 127869538
.......  (note all these between lines will start with hyphen '-' )
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr9.scr 127869538
10.9.9.140
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr5.scr 127869538
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr6.scr 127869538
.......     (note all these between lines will start with hyphen '-' )
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr9.scr 127869538
myhost1
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr5.scr 127869538
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr6.scr 127869538
.......    (note all these between lines will start with hyphen '-' )
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr9.scr 127869538
..... (and so on)

This is how i run the script:

./readfile.sh '10.9.9.85\\n-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr5.scr 127869538\\n-rwxr-xr-x user1 2019-10-15 17:40 /app/mrt/testingscr6.mrt 4119663872\\n-rwxr-xr-x user1 2019-10-15 17:40 /app/exe/testingscr9.exe 1799452894\\n10.9.9.140\\n-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr5.scr 127869538\\n-rwxr-xr-x user1 2019-10-15 17:40 /app/mrt/testingscr6.mrt 4119663872\\n-rwxr-xr-x user1 2019-10-15 17:40 /app/exe/testingscr9.exe 1799452894'

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:

/app/scripts/testingscr5.scr
/app/scripts/testingscr6.scr
.......
 /app/scripts/testingscr9.scr

below is what i did so far:

#!/bin/ksh
VAR1=`echo "${1}" | sed -e "s/'//g"`
echo "${VAR1}" |
  while IFS=' '
read -r dirpath
do
  fileis=`echo "$dirpath" | awk -F' '  '{ print $5 }'`
  echo "FILE IS:$fileis"
 done

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

Resolved the issue by this logic

VAR1=`echo "${1}" | sed -e "s/'//g"`
echo "${VAR1}" |
  while IFS=' '
read -r dirpath
do
        if [ $tmp -le 1 ]; then
  fileis=`echo "$dirpath" | awk -F' '  '{ print $5 }'`
  echo "FILE IS:$fileis"
         if [[ "$fileis" == "/"*  ]]; then
        echo "This is the File:$fileis"
        filelist[$count]="$fileis"
         count=`expr $count + 1`
        echo "INCREMENT VALUE:$count"
        else
         tmp=`expr $tmp + 1`
         echo "INCREMENT BY:$tmp"
         fi
           else
         break;
          fi   
done

Trivial example using PHP:

cat example.php
<?php

$stuff = '-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr5.scr 127869538
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr56.scr 127869538
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr9.scr 127869538
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr5.scr 127869538
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr6.scr 127869538
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr9.scr 127869538
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr5.scr 127869538
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr6.scr 127869538
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr9.scr 127869538';

foreach(preg_split("/((\r?\n)|(\r\n?))/", $stuff) as $line)
{
$pieces = explode(' ',$line);
echo $pieces[4] . "\n"  ;
}
osx$ php example.php
/app/scripts/testingscr56.scr
/app/scripts/testingscr9.scr
/app/scripts/testingscr5.scr
/app/scripts/testingscr6.scr
/app/scripts/testingscr9.scr
/app/scripts/testingscr5.scr
/app/scripts/testingscr6.scr
/app/scripts/testingscr9.scr

Modify as you please.

How about

echo "${1//\\\\n/$'\n'}" | awk '$5 {print "File is:", $5}'
File is: /app/scripts/testingscr5.scr
File is: /app/mrt/testingscr6.mrt
File is: /app/exe/testingscr9.exe
File is: /app/scripts/testingscr5.scr
File is: /app/mrt/testingscr6.mrt
File is: /app/exe/testingscr9.exe
Moderator comments were removed during original forum migration.