First page Back Continue Last page Overview Image
Though time, standard tools have been added to UNIX
- regular expressions: a coded language to describe feature in text
- grep: filters lines in a file for a phase, has flag to control what is printed
- sed: copies lines in a file modifying those indicate by a command. The command can be a file of commands and the file is processed line by line
- wc: counts line or characters in a file
- for var in LIST ; do cmd ; done will repeat the command cmd as many times as elements in list and var will take the value of every element in LIST, one at a time
- if test then cmd else cmd fi
- '[Jj]u.a.*' : matches: Juán, Juan, juan, juanito, Juanita, Ju'a, jurassic, etc.
- grep "^ATOM" file : will print all lines starting with ATOM in a file
- sed '300,350 s/^ATOM /HETATM/' file : will print file, but lines starting with ATOM between line 300 and line 350 will now start with HETATM
- wc -l X.fa :
will print the nº of lines in "X.fa"
- for nfl in `ls *.pdb` ; do grep "^ATOM" ${nfl} | wc -l ; done : will print a list of the number of ATOM records in all pdb files in the current folder.
- if test’s a condition and act accordingly.
TOOL
Example
Notes:
A través del tiempo, se han desarrollado y establecido herramientas poderosas en el UNIX.
Aquí sólo algunos ejemplos.
Analícelos con cuidado.
Note el poder de usar ciclos, para trabajos repetitivos.
Así como condicionales, para tomar decisiones basadas en comparaciones.