IF statement help

Is it possible to make an IF statement checking if the $1 of a program is equal to any of the lines of the 5th field of a specific file name?

if [[ "$1" == cat example.txt | cut -f5 ]]; then 

this is what i thought of, but it doesn't work.

Something like this should do it for you:

#!/usr/bin/bash
oIFS=$IFS  ## Save current setting
IFS="-"    ## Set this to field delimter if it is not white space
while read -a Arr theFile
do
  if [ "$1" = "${Arr[4]}" ]; then
    echo ${Arr[4]}
done < file_name
IFS=$oIFS

I don't understand what you're trying to do.
Are you saying that you want to match $1 to the 5th field in a filename that contains at least four tab characters?

Are you saying that you want to match $1 against the 5th tab separated field in the files named in example.txt?

Are you saying that you want to match $1 against the 5th tab separated field in example.txt?

Or, is it something else that you're trying to match?

what is Arr?

---------- Post updated at 10:36 PM ---------- Previous update was at 10:31 PM ----------

i'm trying to match the first parameter when i run the program with the 5th tab seperated field in example.txt.

so,

scriptname parameter

And is $1 a basic regular expression, an extended regular expression, a file matching pattern, or a fixed string?

When there is a match, do you just want to print that field, or do you want to print the entire line on which the matching field was found?

If more than one match occurs, do you want to print every line or field that matches, or just the first one?

It is the array name that contains each field(i.e. element) from each record in the file.