Difficulty with a couple commands porting from korn shell to bash

I am relatively new to shell scripting. I have a script I wrote that works fine in korn shell.

I need to make it work in bash on a different server.

There are a couple valid korn shell commands I am having difficulty finding the bash equivalents for.

At one point the scripts prompts the user for their IP to export display. The read command used in the kornshell version to control a timeout is not valid in bash:

# Prompt for IP address 
  echo "Enter your IP address and press Return: "
  if read -t 90 ipadd; then    #90 second timeout if no user input.
     export DISPLAY=$ipadd:0.0
  else
    echo "Too much time has elapsed. Terminating script."
    exit 1
  fi

The error generated is read: -t: unknown option.

Users are asked later to specify the binary they want to run. bash is not interpreting the kornshell command. They are giving a list of binaries then script goes to the directory the binaries are in, and, if it is a valid name, executes it. If it is not found it just returns and invalid message.

None of the binaries are being found even though they are valid. The if [ -f ....] construct is not working in bash.

if [ -f /path/to/binary/$variable ]; then
                /path/to/binary/$variable
        
            finished=1
    
            else
        
            echo "Invalid selection. Please try again."
 fi

Any suggestions would be greatly appreciated. Thank you for your time.

[/LEFT] [LEFT]

On the original computer, what Operating System and version?
On the new computer, what Operating System and version?

Item 1) Standard "ksh" (ksh88) does not have "read -t". What ksh do you have?
Item 2) Please post sample values of $variable and matching error messages.

Ps: For X-Windows DISPLAY Environment Variable you should be able to detect your own IP address indirectly via an appropriate who am i command (syntax varies).
e.g. who -R am i or whatever is valid on your system and processed to extract the IP address.
Obviously this would remove the need for "read -t".

Thank you for the suggestion methyl. I eliminated the read -t statement entirely.

Here is the exact error I am seeing with the is statement. I am trying to say if the variable is one thing, execute the listed commands. For anything else, check the relevant directory and if the bin file is there run it, if not throw an error. There is an issue with my elif statement.
The shell it worked on was ksh-20100202-1.el5_6.5 on Red Hat Enterprise Linux Server release 5.6 (Tikanga).
It it not working on version 3.2.25(1)-release (x86_64-redhat-linux-gnu) on Red Hat Enterprise Linux Server release 5.7 (Tikanga)

# Specify console to be run
tries=0
limit=3
finished=0


while [ ${finished} -eq 0 ] && [ ${tries} -lt ${limit} ]; do

        echo "Specify the executable you would like to run and press Return: "
        read console;

                if [[ ${console} == "mstrdiag" ]]; then  #specify log file if doing diagnostics.
                        echo "Please enter the name of your destination logfile."
                        echo "The log file you specify will be in the same location as the DSSErrors log."
                                touch /logs/out/${logfile}
                                chown `whoami`:staff /logs/out/${logfile}
                                chmod 775 /logs/out/${logfile}
                                finished=1
                                /test/apps/mstr/bin/$console

                elif [ -f /test/apps/mstr/bin/$console ]; then
                        /test/apps/mstr/bin/$console

                        finished=1

                        else

                        echo "Invalid selection. Please try again."
                fi


        tries=`expr ${tries} + 1`
done
+ [ 0 -eq 0 ]
+ [ 0 -lt 3 ]
+ echo Specify the executable you would like to run and press Return:
Specify the executable you would like to run and press Return:
+ read console
mstrconnectwiz
+ [ -f /test/apps/mstr/bin/mstrconnectwiz ]
+ echo Invalid selection. Please try again.
Invalid selection. Please try again.
+ expr 0 + 1
+ tries=1
+ [ 0 -eq 0 ]
+ [ 1 -lt 3 ]
+ echo Specify the executable you would like to run and press Return:
Specify the executable you would like to run and press Return:
+ read console

What does ls -l /test/apps/mstr/bin/mstrconnectwiz say?

Thanks for replying. The executable is in a root owned directory. I do not get root access. Sudo rights were applied so the commands in the script execute as root. If I ls -l I will just get permission denied. I did confirm with a unix admin that the file exists.

OK, then what does sudo ls -l /test/apps/mstr/bin/mstrconnectwiz say? Or if the sudo rights are for the script itself, insert ls -l /test/apps/mstr/bin/mstrconnectwiz into the script to test its presence and or its readability of the directory it is in.