getMachineType

 proc getMachineType { } {
       global env
  
       if {[info exists env(OS)]} {
    return nt
       } else {
    set os [exec uname]
    switch -exact -- $os {
        OSF1   { return decunix }
        IRIX64 { return irix }
        Linux {
     set mach [exec uname -m]
     switch -exact -- $mach {
         i686 { return linux }
         x86_64 { return linux64 }
         ia64 { return ia64 }
     }
        }
    }
       }
       ### reach here, unknown machine
       puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
       puts "Unknow MACHINE, please edit bluice.tcl to find right MACHINE!!"
       puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
  
       return ""
   }
posted @ 2011-05-20 21:57  greencolor  阅读(116)  评论(0编辑  收藏  举报