Here is the whole script, very simple, but I am just learning
ROK_NO=$1
RPT=/tmp/test
sed -E '/^SELECT/ s/(.{23}).{8}/\1'"$ROK_NO"' /' $RPT
echo $RPT
When I run this I get
$ bash rok.sh 2388085
: No such file or directory
/tmp/test
When I type the command in console, it works (so I know there is a file there)
sed -E '/^SELECT/ s/(.{23}).{7}/\12388099 /' /tmp/test
Here is what the test file looks like before
SELECT: ROK_NUMBER EQ 2388090
Here is what it looks like after
SELECT: ROK_NUMBER EQ 2388099
That great but I want to use a script so I pass that number as an argument and use the $RPT variable? I'm sure it's something to do with the characters in the sed command and how I'm incorrectly using " vs ' but I cannot figure it out after hours of fiddling
$ bash rok.sh 2388123
: No such file or directory
$
Thanks for taking a look. I'm not sure what else I can do explain.
--- Post updated at 10:14 PM ---
Ok I will try that. I am using Textpad on my Windows PC then FTP the script file over to a Linux server where I'm trying to execute the script. I was just looking at this and was wondering what it all meant :o
--- Post updated at 10:22 PM ---
Dang man, that definitely did the trick. I didn't think I could mess up 2 variables and it was really making me sad. You saved the day -- thank you!