File: miracradical

package info (click to toggle)
smiles-scripts 0.3.0%2Bsvn878%2Bbranch%2Bsystem%2Bdeps-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,860 kB
  • sloc: perl: 1,889; java: 1,218; sh: 1,092; makefile: 246
file content (28 lines) | stat: -rwxr-xr-x 797 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /bin/bash
# Moves to another directory all SMILES containing a carbon atom which
# appears not to be tetravalent. These SMILES should be checked to see if
# they are organometallic compounds, they contain bonds with wrong bond orders
# or are genuine radicals (quite infrequent).

[ -d ../working ] || mkdir ../working
for i in `ls *.smi` ; do
   dato=`cat $i | grep [[]C[]]`
   if [ "$dato" != "" ]; then
     mv $i ../working
   else  
     dato=`cat $i | grep [[]CH[]]`
     if [ "$dato" != "" ]; then
       mv $i ../working
     else
       dato=`cat $i | grep [[]CH2[]]`
       if [ "$dato" != "" ]; then
         mv $i ../working
       else
         dato=`cat $i | grep [[]CH3[]]`
         if [ "$dato" != "" ]; then
           mv $i ../working
         fi
       fi
     fi
   fi
done