Creating script - grep wont work?

This is my first script and I wont get it working.. sorry for being a total noob but here it is:

#./bin/sh -x
echo "1:st argument = $1";
echo "2:nd argument = $2";
grep "$1" "$2"

In the terminal I write, for example, su.sh sausage sausage.txt
Also tried su.sh "sausage" "sausage.txt" but none of them works (trying to find the word sausage in the file sausage.txt)!
However, the first two echo lines work perfectly but the grep line does nothing.. doesn't matter which file I try to open. Tried a file with no .txt extension and still nothing happened. Something I did wrong??

Hi.

There's a typo on your first line:

#./bin/sh -x

is probably meant to be

#!/bin/sh -x

But that really shouldn't affect anything with such a simple script.

The script looks OK to me, and works when running it as you suggested.

What is the actual output, if any you get, and what is your default shell?

Ah!
I changed the . into ! and now it works. The tutorial I read listed a dot and therefor I thought that was the right character.. thanks so much! :slight_smile: