Since you've stated you're new to this, I'm going to first answer some problems that you haven't asked.
Your shebang is wrong
The first bytes of your script should be #!
(a hash and an exclamation mark; referred to as a shebang). You have #1
(hash-one), which is gibberish. This shebang line tells the system to use bash
to interpret your file (i.e. your script) when executed. (More or less. Technically speaking, it's actually given to env
, which finds bash
before handing it over.)
Once you've fixed up the shebang, set the permissions on the script to let the system know it's executable:
$ chmod a+x test.sh
Then run it like so:
$ ./test.sh 123456
As @gokcehan also commented, running your script with sh ...
when you have a shebang is redundant, and isn't preferable for other reasons.
As for what you were asking, you can easily test your regex replacement:
$ echo tableNameNUMBER | sed "s/NUMBER/123456/"
tableName123456
And it seems to work just fine.
Note: The preceding $
merely denotes that I typed it into my console and isn't part of the actual command.