program readsac parameter(max=400000) character nin*100, cmd*100 real*4 x(max) nin='/home/sgao/demo/04_sac/st05.sac' open(9,file='filter.mac') write(9,91) nin 91 format('read ', a50,/ & 'rtrend',/ & 'bp c 0.01 0.1 npoles 4 passes 2',/ & 'write st05f.sac',/ & 'quit') close(9) cmd='sac filter.mac' call system(cmd) print*,'The filtered SAC file is st05f.sac' end