我正在用Fortran编写代码,以便从文件中读取属性列表,并使用IOSTAT函数跳过无效数据。代码的相关部分如下:
do j=1,1000
read(22,*,IOSTAT=ios) step,T,K,U,Tot,P
If(IS_IOSTAT_END(ios)) Exit !exits loop if value is not number or end of file
IF(ios.ne.0) cycle
sumT=sumT+T
sumU=sumU+U
sumK = sumK + K
sumKsq = sumKsq + (K**2.d0)
end if
end do
这段代码以前在Lin
将脚本运行到ssh并返回iostat错误时,
solaris_command = "iostat -en | awk 'NR>=3 && $4 > 0' | while read a b c d e; do echo $e,$a,$b,$c,$d; done"
for line in server_list:
line_arr = line.split(',')
if line_arr[0] == 'SunOS':
ie = subprocess.Popen(["