Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > script advice

Reply
Thread Tools

script advice

 
 
nkomli@gmail.com
Guest
Posts: n/a
 
      02-14-2006
I'm trying to use a script to automate some Terminal command line work
I'm doing. Basically I'm inputting a filename, then running one set of
files with the sander program to generate an rst file used to start a
loop that will run the sander program again five times with other sets
of files. Since I don't have experience making scripts I'd like to show
what I've got so far to see if there are any mistakes. I don't know if
the filenames I'm using would work...


#!/bin/csh
set AMBERHOME="/usr/local/AMBER8"
set MDSTARTJOB=2
set MDENDJOB=6
set MDCURRENTJOB=$MDSTARTJOB
set MDINPUT=1

echo -n "enter filename"
$filename=<STDIN>
chop($filename);

echo -n "Starting Script at: "
date
echo ""


echo -n "Warming started at: "
date
$AMBERHOME/exe/sander -O -i hot.in \
-o hot$filename.out \
-p $filename.prmtop \
-c $filename.rst \
-r $filename$MDINPUT.rst \
-x hot$filename.mdcrd

echo -n "Job hot$filename finished at: "
date



while ( $MDCURRENTJOB <= $MDENDJOB )
echo -n "Job $MDCURRENTJOB started at: "
date
@ MDINPUT = $MDCURRENTJOB - 1
$AMBERHOME/exe/sander -O -i mdp53.in \
-o $filename$MDCURRENTJOB.out \
-p $filename.prmtop \
-c $filename$MDINPUT.rst \
-r $filename$MDCURRENTJOB.rst \
-x $filename$MDCURRENTJOB.mdcrd
gzip -9 -v $filename$MDCURRENTJOB.mdcrd
echo -n "Job $MDCURRENTJOB finished at: "
date
@ MDCURRENTJOB = $MDCURRENTJOB + 1
end
echo "ALL DONE"

 
Reply With Quote
 
 
 
 
Brian Wakem
Guest
Posts: n/a
 
      02-14-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> I'm trying to use a script to automate some Terminal command line work
> I'm doing. Basically I'm inputting a filename, then running one set of
> files with the sander program to generate an rst file used to start a
> loop that will run the sander program again five times with other sets
> of files. Since I don't have experience making scripts I'd like to show
> what I've got so far to see if there are any mistakes. I don't know if
> the filenames I'm using would work...
>
>
> #!/bin/csh



Wrong group.



--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
 
Reply With Quote
 
 
 
 
nkomli@gmail.com
Guest
Posts: n/a
 
      02-14-2006
which group then?

 
Reply With Quote
 
Matt Garrish
Guest
Posts: n/a
 
      02-14-2006

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ps.com...
> which group then?
>


What group now? Hello, context?

Matt


 
Reply With Quote
 
nkomli@gmail.com
Guest
Posts: n/a
 
      02-14-2006
I put up my script hoping to see if there was any bad syntax mistakes I
could fix but someone simply said wrong group without telling me where
I should go. All the more closely related groups I've seen only get
like 5 messages a year.

 
Reply With Quote
 
Matt Garrish
Guest
Posts: n/a
 
      02-14-2006

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
>I put up my script hoping to see if there was any bad syntax mistakes I
> could fix but someone simply said wrong group without telling me where
> I should go. All the more closely related groups I've seen only get
> like 5 messages a year.
>


Hello, context? What script?

If you choose to use Google to read usenet posts that's fine, but the
expectation that others will hunt back through your posts to find out what
you're talking about is considered quite rude. In the future, quote enough
of the message you are replying to so that someone can understand you
without having to read anything else.

That said, if you were told you were in the wrong group, why should the
person pointing it out to you be expected to tell you the right group? And
low traffic in another group is not an excuse for posting off-topic
questions here. This wouldn't be comp.lang.perl.misc if it were a forum for
asking anything that comes to mind, would it?

Matt


 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      02-15-2006
(E-Mail Removed) wrote:
> I'm trying to use a script to automate some Terminal command line work
> I'm doing. Basically I'm inputting a filename, then running one set
> of files with the sander program to generate an rst file used to
> start a loop that will run the sander program again five times with
> other sets of files. Since I don't have experience making scripts I'd
> like to show what I've got so far to see if there are any mistakes. I
> don't know if the filenames I'm using would work...
>
>
> #!/bin/csh


If you want perl to execute your script you may want to to say so:
#!/bin/perl

You are missing
use strict;
use warnings;

> set AMBERHOME="/usr/local/AMBER8"
> set MDSTARTJOB=2
> set MDENDJOB=6
> set MDCURRENTJOB=$MDSTARTJOB
> set MDINPUT=1
>
> echo -n "enter filename"
> $filename=<STDIN>
> chop($filename);
>
> echo -n "Starting Script at: "
> date
> echo ""

[...]

And then you got a whole bunch of syntax errors:
Semicolon seems to be missing at t.pl line 1.
Semicolon seems to be missing at t.pl line 2.
Semicolon seems to be missing at t.pl line 3.
Semicolon seems to be missing at t.pl line 4.
Semicolon seems to be missing at t.pl line 6.
syntax error at t.pl line 2, near "set MDSTARTJOB"
Unrecognized file test: -n at t.pl line 7.

I think you have some serious work ahead of you to rewrite this script into
valid Perl.

jue


 
Reply With Quote
 
Ian Wilson
Guest
Posts: n/a
 
      02-15-2006
(E-Mail Removed) wrote:
> which group then?
>

http://groups.google.com/googlegroup...html#summarize
 
Reply With Quote
 
Ian Wilson
Guest
Posts: n/a
 
      02-15-2006
(E-Mail Removed) wrote:
> I put up my script hoping to see if there was any bad syntax mistakes I
> could fix but someone simply said wrong group without telling me where
> I should go. All the more closely related groups I've seen only get
> like 5 messages a year.
>


http://www.catb.org/~esr/faqs/smart-...ons.html#forum

http://mail.augustmail.com/~tadmc/cl..._your_question
 
Reply With Quote
 
John W. Krahn
Guest
Posts: n/a
 
      02-15-2006
(E-Mail Removed) wrote:
> which group then?


Nobody I know on usenet will help you with a csh script. Pick another language.

http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/


John
--
use Perl;
program
fulfillment
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute a script from another script and other script does notdo busy wait. Rajat Python 3 01-08-2010 02:05 PM
RE: How to execute a script from another script and other script doesnotdo busy wait. VYAS ASHISH M-NTB837 Python 2 01-07-2010 08:18 PM
Needed: Advice on Film Scanning, Or Website Which Has This Advice Larry R Harrison Jr Digital Photography 0 09-06-2003 01:00 AM
Re: Celebrity advice (was: Advice to a Junior in High School?) Peter Hansen Python 23 09-05-2003 03:11 PM
Re: Celebrity advice (was: Advice to a Junior in High School?) Asun Friere Python 1 08-27-2003 12:01 PM



Advertisments