Question: I want to run a shell script. This script have a long name. So I want to use filter for file.

ex: `ls | grep myfile | ./`

Is it possible to execute a file with filter.

Answer: 
Just type:

```
*myfile*

```

You can also do:

```
"$(ls | grep pattern)"

```

if you full regular expression matching rather than just filename wildcards.

All these solutions assume there's just a single file in the current directory that matches the pattern.
You can use [`xargs`](http://linux.die.net/man/1/xargs) for this sort of thing:

```
ls | grep myfile | xargs sh

```

`xargs` reads lines on its input and gives them as arguments to the program it's given as argument: here, it will read the output of grep and then run `sh long_myfile_name`. (Change `sh` to `bash` if your script depends on Bash-specific features, or some other shell)

You can also run `sh *myfile*` with essentially the same effect in this simple case — if your `grep` is more complicated you may not be able to do that, but `sh "$(ls | grep ...)"` will work.

---

That said, there are some reasons you might not want to do this: in particular, if it's possible that there will at some point be two files that match your `grep`. At that point one of three things will happen: your script gets an extra argument, two different scripts are run, or another script is run instead. You could, say, pipe into `head -n 1` to avoid the first two, but then an arbitrary one will be executed, which isn't much help. In the `$()` case it will just fail, which is probably the best of a bad set of outcomes. If there are spaces in the filenames you'll have to take even more care.

Your shell's tab completion may be a better option: you can likely write `*myfile*` and hit TAB to get either a correct expansion or an indication that there is more than one possibility, or even just start to write the name and tab complete to the end. If you're running this in a script, just put the full name there — you only have to write it once. The answer above the line will work, but I don't really recommend it.