Hi Experts:
I am trying to write a simple unix script. I am pretty sure it can be done but I am having issue with it. I am trying to write a unix script when user enter a file, cat the file and another file to create another file an then exec it/run.
Here is a sample of my script(test.sh):
#!/bin/sh
InFile=`myinfo.info`
while read line
do
echo $line
exec cat $FILE add_info.inf > all_info.sh
done < $InFile
exec ./all_info.sh
When I run this, it ./test.sh, I got this error message:
./test.sh: line 2: ./myinfo.info: Permission denied
./test.sh: line 8: $InFile: ambiguous redirect
Also how do I print on the screen to see content of the file?
Any insight on what I am doing wrong is greatly appreciated.
Thanks in advance.
I am trying to write a simple unix script. I am pretty sure it can be done but I am having issue with it. I am trying to write a unix script when user enter a file, cat the file and another file to create another file an then exec it/run.
Here is a sample of my script(test.sh):
#!/bin/sh
InFile=`myinfo.info`
while read line
do
echo $line
exec cat $FILE add_info.inf > all_info.sh
done < $InFile
exec ./all_info.sh
When I run this, it ./test.sh, I got this error message:
./test.sh: line 2: ./myinfo.info: Permission denied
./test.sh: line 8: $InFile: ambiguous redirect
Also how do I print on the screen to see content of the file?
Any insight on what I am doing wrong is greatly appreciated.
Thanks in advance.