Harry Hahn wrote:
> I recently had to run chopup on a large number of
> automated-sequencer-generated sequences and discovered "chopup *" does
> not
> work. Then I had to reverse the sequences and discovered "reverse" has
> the
> same, um, "feature."
>> Any suggestions on how to make this process easier? We're running the
> Korn
> shell and I imagine there's a way but I'm stumped for now and would
> appreciate some pointers.
>> Thanks,
> Harry
>> --
> Harry Hahn <h3 at ucla.edu>
> Research and Instructional Biocomputing Services - UCLA
The following script was written in csh. Sorry, don't have access to
the korn shell (nor do I know much about it). If you have the csh
installed in /bin then this script should work (you'll probably have to
insert the csh specific gcgstartup scripts also). Or (probably better),
you might be able to translate the csh script to a ksh script.
------------------- 8< ----- Begin Snip Here --------->8 ---------
#!/bin/csh
#
# multi_gcg_csh
#
# created by Karl J. Smalley on 1/9/98
#
# usage:
#
# multi_gcg_csh "gcg command with paramaters" *.seq
#
# The double-quotes are only neccesary for commands that are
multiple
# words or require command line options. For example the following
# works fine:
#
# multi_gcg_csh reformat *.seq
#
# purpose:
#
# The purpose of this csh script is to facilitate running the same
# gcg command on mutiple files. Since the script just reruns the
# program many times with each file in the argument list, the user
# will be prompted for any input on each and every file. For
example
#
# multi_gcg_csh chopup *.txt
#
# will ask for the output file name for every file with the
extension
# .txt (each time chopup is run). However,
#
# multi_gcg_csh "chopup -DEF" *.txt
#
# will run accepting all defaults, which for chopup would replace
.txt
# with .dat on the copped up output file, with out stopping for user
# input.
#
##############################################################################
echo $0 " now processing " $argv
if ($#argv < 2) goto usage
# :q appended so that multiple word argument is treated as one string
if ($argv[1]:q == "-h") goto usage
if ($argv[1]:q == "-?") goto usage
if ($argv[1]:q == "-help") goto usage
if ($argv[1]:q == "help") goto usage
@ i = 2
while($i <= $#argv)
echo $1 $argv[$i]
$1 $argv[$i]
@ i++
end
exit
usage:
more $0
------------------- 8< ----- End Snip Here --------->8 ---------
Hope this is of some help to you.
--
----------------------------------------------------------------------
Karl J. Smalley
Systems Analyst
Snail Mail:
Phone: (215) 503-4602 Kimmel Cancer Center
FAX: (215) 923-2117 Thomas Jefferson University
E-Mail: mailto:K_Smalley at lac.jci.tju.edu 812 BLSB, 233 S. 10th St.
WWW http://www.jci.tju.edu/~karl Philadelphia, PA 19107
"Mate in 3" - The sweetest words I have ever heard myself utter.
******* This is a Chess Phrase and nothing more **********
------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://iubio.bio.indiana.edu/bionet/mm/info-gcg/attachments/19980109/a798cd59/attachment.html