Passing string as variable(s) in bash

I'm trying to write a basic bash script that takes input you give (what directory, if any, what name, if any ....) and passes the information to find.

I'm trying to just create a string with all variables and then pass it to find. So far I have this extremely simple:

#!/bin/bash -f

test_str="-name bin"
find `$test_str`

I'm trying to make it the same as

find -name bin

Could someone give me an idea on how to achieve that?

No backticks!

find $test_str

In case you mean "passing arguments to the script":

find $1 $2 $3
find "$@"
1 Like

Haha, thanks a lot! No backticks worked like a charm. I'm extremely new to writing scripts - as you can probably tell.

It was so obvious yet I complicated it unnecessarily. Once again, thanks. :o