FILE1:
at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:940)
at com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:198)
at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:712)
at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:469)
at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1230)
РЯа. 19, 2021 4:14:16 PM com.lhs.ccb.sfw.application.ServiceObjectImpl executeLocaleI
SEVERE: ServiceObjectI.executeLocaleI CONTRACT.WRITE档案2:
Error code: CommonDomain.InvalidStateTransition
at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1700)
at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1558)
at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:940)
at com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:198)
at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:712)
РЯа. 19, 2021 4:14:16 PM com.lhs.FrameworkExtension.bscs_core.d getErrorMessage
WARNING: no localized text available for:
ErrorCode : InvalidStateTransition
BundleName: CommonDomain_ErrorDictionary
Locale : en_US
Reason : XMlResourceException: ResourceBundleManager: Can not find resource bundle 'CommonDomain_ErrorDictionary'
РЯа. 19, 2021 4:14:16 PM com.lhs.FrameworkExtension.bscs_core.d getErrorMessage
WARNING: no localized text available for:
ErrorCode : InvalidStateTransition
BundleName: CommonDomain_ErrorDictionary
Locale : en_US
Reason : XMlResourceException: ResourceBundleManager: Can not find resource bundle 'CommonDomain_ErrorDictionary'
РЯа. 19, 2021 4:15:42 PM com.lhs.ccb.sfw.application.ServiceObjectImpl executeLocaleI
SEVERE: ServiceObjectI.executeLocaleI CONTRACT.WRITE档案3:
Error code: CommonDomain.InvalidStateTransition
at com.lhs.ccb.sfw.application.ServiceObjectImpl.execute(Unknown Source)
at com.lhs.cil.core.AggregatedServiceObjectImpl.execute(Unknown Source)
at com.lhs.ccb.sfw.application.ServiceObjectImpl.executeLocaleI(Unknown Source)
at com.lhs.cil.core.AggregatedServiceObjectImpl.executeLocaleI(Unknown Source)
at com.lhs.ccb.soi.ServiceObjectIPOA._invoke(Unknown Source)
РЯа. 19, 2021 4:20:21 PM com.lhs.FrameworkExtension.bscs_core.d getErrorMessage
WARNING: no localized text available for:
ErrorCode : InvalidStateTransition
BundleName: CommonDomain_ErrorDictionary
Locale : en_US
Reason : XMlResourceException: ResourceBundleManager: Can not find resource bundle 'CommonDomain_ErrorDictionary'
РЯа. 19, 2021 4:20:21 PM com.lhs.FrameworkExtension.bscs_core.d getErrorMessage
WARNING: no localized text available for:
ErrorCode : InvalidStateTransition
BundleName: CommonDomain_ErrorDictionary
Locale : en_US
Reason : XMlResourceException: ResourceBundleManager: Can not find resource bundle 'CommonDomain_ErrorDictionary'
РЯа. 19, 2021 4:21:22 PM com.lhs.ccb.sfw.application.ServiceObjectImpl executeLocaleI
SEVERE: ServiceObjectI.executeLocaleI CONTRACT.WRITE
Error code: CommonDomain.InvalidStateTransition
at com.lhs.CommonDomain.bscs_core.ae.a(Unknown Source)
at com.lhs.cil.core.AggregatedServiceObjectImpl.execute(Unknown Source)
at com.lhs.ccb.sfw.application.ServiceObjectImpl.executeLocaleI(Unknown Source)
at com.lhs.cil.core.AggregatedServiceObjectImpl.executeLocaleI(Unknown Source)
at com.lhs.ccb.soi.ServiceObjectIPOA._invoke(Unknown Source)
РЯа. 19, 2021 4:21:22 PM com.lhs.FrameworkExtension.bscs_core.d getErrorMessage
WARNING: no localized text available for:
ErrorCode : InvalidStateTransition
BundleName: CommonDomain_ErrorDictionary
Locale : en_US
Reason : XMlResourceException: ResourceBundleManager: Can not find resource bundle 'CommonDomain_ErrorDictionary'
РЯа. 19, 2021 4:21:22 PM com.lhs.FrameworkExtension.bscs_core.d getErrorMessage
WARNING: no localized text available for:
ErrorCode : InvalidStateTransition
BundleName: CommonDomain_ErrorDictionary
Locale : en_US
Reason : XMlResourceException: ResourceBundleManager: Can not find resource bundle 'CommonDomain_ErrorDictionary'
РЯа. 19, 2021 4:26:22 PM com.lhs.ccb.sfw.application.ServiceObjectImpl executeLocaleI
SEVERE: ServiceObjectI.executeLocaleI CONTRACT.WRITE
Error code: CommonDomain.InvalidStateTransition
at com.lhs.ccb.sfw.application.ServiceObjectImpl.execute(Unknown Source)
at com.lhs.cil.core.AggregatedServiceObjectImpl.execute(Unknown Source)
at com.lhs.ccb.sfw.application.ServiceObjectImpl.executeLocaleI(Unknown Source)
at com.lhs.cil.core.AggregatedServiceObjectImpl.executeLocaleI(Unknown Source)
at com.lhs.ccb.soi.ServiceObjectIPOA._invoke(Unknown Source)
РЯа. 19, 2021 4:26:22 PM com.lhs.FrameworkExtension.bscs_core.d getErrorMessage
WARNING: no localized text available for:
ErrorCode : InvalidStateTransition
BundleName: CommonDomain_ErrorDictionary
Locale : en_US
Reason : XMlResourceException: ResourceBundleManager: Can not find resource bundle 'CommonDomain_ErrorDictionary'
РЯа. 19, 2021 4:26:22 PM com.lhs.FrameworkExtension.bscs_core.d getErrorMessage
WARNING: no localized text available for:
ErrorCode : InvalidStateTransition
BundleName: CommonDomain_ErrorDictionary
Locale : en_US
Reason : XMlResourceException: ResourceBundleManager: Can not find resource bundle 'CommonDomain_ErrorDictionary'
РЯа. 19, 2021 4:30:40 PM com.lhs.ccb.sfw.application.ServiceObjectImpl executeLocaleI
SEVERE: ServiceObjectI.executeLocaleI CONTRACT.WRITE我想要创建一个shell脚本,它将以读取第一个文件的方式读取这些文件,并在severe1中提取严重的行,然后提取warning1中的警告行。然后传递第二个文件,以便severe2中的严重行,然后warning2中的警告行与最后一个文件(10个文件)相同。做这件事最简单的方法是什么?
我检查的方式如下:**
for i in (ls *.log); do
cat *.log|grep "SEVERE" > severe$i.txt
cat *.log|grep "WARNING" > warning$i.txt
done;**
发布于 2021-05-06 13:43:58
您的代码有几个问题:
for i in (ls *.log); do(...),它应该是$(...),但是根本不需要它,因为.ls,而不是使用for f in *.log; do$i不是计数器,而是文件名,您必须手动添加计数器。循环和增量之前的i=0,例如循环中的i=$((i+1))。(然后使用for f in *.log)。cat *.log|grep "SEVERE" > severe$i.txt虽然这本身并不是“错误”的,但在这种情况下仍然存在问题。
grep从文件中读取,不需要cat:grep -h“严厉”*.log > severe$i.txt*.log?-F选项添加到grep中。-w。... > "severe$i.txt"。所以,总的来说,我会:
i=0
for f in *.log; do
i=$((i+1))
grep -Fw "SEVERE" "$f" > "severe$i.txt"
grep -Fw "WARNING" "$f" > "warning$i.txt"
done或者全部放在一个awk中:
awk '
FNR==1{FILENUM+=1}
/^SEVERE/{print > "severe"FILENUM".txt"}
/^WARNING/{print > "warning"FILENUM".txt"}
' *.loghttps://unix.stackexchange.com/questions/648408
复制相似问题