[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-date: Thu Apr 21 18:10:34 2005 -->
- <!--x-from-r13: Rbj.Vhefg ng zvaqfcevat.pbz (Rbj Vhefg) -->
- <!--x-message-id: [email protected] -->
- <!--x-subject: [ale] Scripting question -->
- <li><em>date</em>: Thu Apr 21 18:10:34 2005</li>
- <li><em>from</em>: Dow.Hurst at mindspring.com (Dow Hurst)</li>
- <li><em>subject</em>: [ale] Scripting question</li>
I want to copy each file four times incrementing the name for each of
the four copies. So the file aea_h6_2-4ns_v2.0000.ppm is copied and
renamed to the destination directory as:
aea.0000.ppm
aea.0001.ppm
aea.0002.ppm
aea.0003.ppm
then I want to increment to the next file in the source directory and
start again. So aea_h6_2-4ns_v2.0001.ppm becomes in the destination
directory:
aea.0004.ppm
aea.0005.ppm
aea.0006.ppm
aea.0007.ppm
I have this bit of code I used for a similar purpose but different
enough that I am having trouble rewriting it to do what I want. I'm
sure perl would be perfect for this but I have simple shell code:
#!/bin/sh
#############################################################
# Ex. ./select.sh '0003' '0000' 'aea_h6_2-4ns_v2.0001.ppm'
/SOURCEPATH/FILE /DEST_PATH/FILE
# Written by Dow Hurst 07-01-2002
#############################################################
j=$1
i=$2
inputfile="$3 $3 $3 $3"
CWD=`pwd`
SOURCE=$4
DEST=$5
################
echo "Changing to SOURCE directory"
cd $SOURCE
for out in $inputfile
do abc=aea.$i.ppm
echo $out $abc
cp -p $SOURCE/$out $DEST/$abc
if [ $i = $j ]
then break
fi
i=`expr $i + 1`
done
echo "Changing back to CWD directory"
cd $CWD
exit
One problem I found is that the 0000 doesn't really work with this
code. You have to use 1000 instead so the file names would go from:
aea_h6_2-4ns_v2.0000.ppm
aea.1000.ppm
The purpose behind this is to feed the files to ppmtompeg to create a
movie. VMD does this but won't repeat a image frame four times.
MainActor will do a slowmo effect but the output is not clear and
sharp. Single frames from the molecular dynamics trajectory end up with
molecules wiggling too fast. VMD has written out here every fourth
frame from the trajectory and I just want to repeat the frame four
times. Hope this makes sense! Thanks for the scripting help,
Dow
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00539" href="msg00539.html">[ale] Scripting question</a></strong>
<ul><li><em>From:</em> fletch at phydeaux.org (fletch at phydeaux.org)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00521.html">[ale] professional groups / associations</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00523.html">[ale] Scripting question</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00543.html">[ale] professional groups / associations</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00539.html">[ale] Scripting question</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00522"><strong>Date</strong></a></li>
<li><a href="threads.html#00522"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>