Funny but true....

Hallo everybody

I am having a shell script called auto_run.sh in that only the first line works.
the second line which has sed command is working only at the # prompt. not within the shell script. What could be the reason.

*... sed 's/ //g' KTI >abc works in another shell script without the first line.when i add the exec....statement it stops working. Please can anyone help me.Thanks

exec auto_inv.4ge >KTI
sed 's/ //g' KTI > abc
exit

Try this and tell me whether now the shell script works are not

exec auto_inv.4ge >KTI
sed 's/ //g' ./KTI > abc
exit

no it didnt work,only file KTI was created.

Use a shell invocation before exec as below.

ksh
exec auto_inv.4ge >KTI
sed 's/ //g' KTI > abc
exit 

Replace ksh with whatever shell you are using.

No sorry to bother you no luck at all

Try prefixing exec command with sh.

sh exec....
sed..
exit

The problem is after exec, the shell is exiting. Hence further commands are not executed.

You can also try providing absolute path for KTI.

Thank you very much for your time and sharing your knowledge. It worked perfectly. thank You once again.Bye