Command not found error 'then'

Could you let me know if my path is having bourne bash

echo $PATH
/u01/app/oracle/product/10.2.0/db_1/bin:/usr/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/oracle/bin

[oracle@station16 ~]$ which bash
/bin/bash

[oracle@station16 ~]$ which ls
alias ls='ls --color=tty'
        /bin/ls

Below is the simple if statment in shell scripting.
I use vi editor

#!/bin/bash -x

age=10;

if[ $age -lt 13 ]

then
    
echo "$age"

else
    
echo "hh"

fi

Error again

+ age=10

+ 'if[ 10 -lt 13 ]'

./test.sh: line 3: if[ 10 -lt 13 ]: command not found.

./test.sh: line 4: syntax error near unexpected token `then'
./test.sh: line 4: `then'

Can anyone help me out . I am new to Shell and Linux environment
Thanks
Matt

give a space after if

1 Like

There should be a space between if and [

1 Like

Thank u all the valuable information.
It helped.