• if-else in awk. Always confuses me...

    awk '{if ($14 == 4) print $0; else print "else"}' b/moviestate0000.dat
    


  • command-line inputting for csh
    #
        if ($#argv < 1) then
            echo "Usage: $0 file [ file ... ]"
            exit 1
        endif
    #
    foreach file ($argv)
            echo -n $file': '
            @ nl = `wc $file | awk '{print $1}'`
            while ($nl > 0)
                echo -n '*'
                @ nl--
            end
            echo ''
        end
    #
    


  • Making gray histograms in SM, and having them print right
    ctype = ctype() concat {14671839 12566463 10461087 8355711 6250335 4144959 2039583} # 223, 191, 159, 127, 95, 63, 31
    ctype = ctype(string) concat {gray1 gray2 gray3 gray4 gray5 gray6 gray7}
    


     sed -e 's/processcolors where/sub where/' -e 's/processcolors/2/' spin_3hr.ps  > blah.ps
    


  • Batch mode for phot
    phot @Images.lis coords=@Coords.coo inter-