当前位置: 技术问答>linux和unix
unix shell__!的用法
来源: 互联网 发布时间:2016-07-21
本文导语: 如下: misql delete from AVIVAGROUP_OPER where GROUPID between "$PROV"0000 and "$PROV"9999 delete from AVIVAROLE where ROLENAME in (select ROLENAME from AVIVAROLE_GROUP where GROUPID between "$PROV"0000 and "$PROV"9999) delete from AVIVAROLE_OPER where...
如下:
misql delete from AVIVAGROUP_OPER where GROUPID between "$PROV"0000 and "$PROV"9999
delete from AVIVAROLE where ROLENAME in (select ROLENAME from AVIVAROLE_GROUP where GROUPID between "$PROV"0000 and "$PROV"9999)
delete from AVIVAROLE_OPER where ROLENAME in (select ROLENAME from AVIVAROLE_GROUP where GROUPID between "$PROV"0000 and "$PROV"9999)
delete from AVIVAROLE_GROUP where GROUPID between "$PROV"0000 and "$PROV"9999
delete from AVIVAROLE_FUNCTIONS where ROLENAME in (select ROLENAME from AVIVAROLE_GROUP where GROUPID between "$PROV"0000 and "$PROV"9999)
delete from AVIVAROLE_USER where ROLENAME in (select ROLENAME from AVIVAROLE_GROUP where GROUPID between "$PROV"0000 and "$PROV"9999)
go
!
>> clearERR.txt
我怎么才能把两个感叹号之间的内容当成一个文件(sql脚本)重定向到misql这个脚本中?不想再生成另外一个文件了。
misql delete from AVIVAGROUP_OPER where GROUPID between "$PROV"0000 and "$PROV"9999
delete from AVIVAROLE where ROLENAME in (select ROLENAME from AVIVAROLE_GROUP where GROUPID between "$PROV"0000 and "$PROV"9999)
delete from AVIVAROLE_OPER where ROLENAME in (select ROLENAME from AVIVAROLE_GROUP where GROUPID between "$PROV"0000 and "$PROV"9999)
delete from AVIVAROLE_GROUP where GROUPID between "$PROV"0000 and "$PROV"9999
delete from AVIVAROLE_FUNCTIONS where ROLENAME in (select ROLENAME from AVIVAROLE_GROUP where GROUPID between "$PROV"0000 and "$PROV"9999)
delete from AVIVAROLE_USER where ROLENAME in (select ROLENAME from AVIVAROLE_GROUP where GROUPID between "$PROV"0000 and "$PROV"9999)
go
!
>> clearERR.txt
我怎么才能把两个感叹号之间的内容当成一个文件(sql脚本)重定向到misql这个脚本中?不想再生成另外一个文件了。
|
给你看个小试验
[root@bat ~]# cat this is a test
> end
> !
hi 《===输出
this is a test
end
[root@bat ~]# cat this is a test
> end
> !
hi 《===输出
this is a test
end