| | |
sed -f clears the file
Thread Solved |
•
•
Join Date: Aug 2007
Posts: 6
Reputation:
Solved Threads: 0
Hi
sed -f /opt/DBACheck.sql.sed /opt/DBACheck.sql > /opt/DBACheck.sql.tmp
mv -f $DBACheck.sql.tmp $DBACheck.sql
where the contents of DBACheck.sql.sed is
{
s%${DBMS_USER}%SYSTEM%g
}
DBACheck.sql is a one line file , that contains line with string DBMS_USER which i want to replace it with SYSTEM.
But on executing i get DBACheck.sql to be an empty file with all its contents erased .
DBACheck.sql -
select granted_role from sys.dba_role_privs where grantee='${DBMS_USER}';
Thanks
Shyamala
sed -f /opt/DBACheck.sql.sed /opt/DBACheck.sql > /opt/DBACheck.sql.tmp
mv -f $DBACheck.sql.tmp $DBACheck.sql
where the contents of DBACheck.sql.sed is
{
s%${DBMS_USER}%SYSTEM%g
}
DBACheck.sql is a one line file , that contains line with string DBMS_USER which i want to replace it with SYSTEM.
But on executing i get DBACheck.sql to be an empty file with all its contents erased .
DBACheck.sql -
select granted_role from sys.dba_role_privs where grantee='${DBMS_USER}';
Thanks
Shyamala
That's really odd... It works OK on my system:
What version of sed are you using? (
-G
$ sed -f DBACheck.sql.sed DBACheck.sql select granted_role from sys.dba_role_privs where grantee='SYSTEM';
What version of sed are you using? (
sed --version )-G
![]() |
Other Threads in the Shell Scripting Forum
- Previous Thread: You could have done it better, but how?
- Next Thread: share up the automatic executor for visual studio cs. net command prompt
| Thread Tools | Search this Thread |






