Re: script advice



nkomli@xxxxxxxxx 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


.



Relevant Pages

  • Re: Replaces files
    ... I'm afraid you're missing the entire point of the exercise. ... The "ask for a name" part corresponds to the InputBox statement. ... > Dim fileName As String ... >>> prompt appears asking if I want to replace. ...
    (microsoft.public.word.vba.general)
  • Re: SMS Collection question
    ... was having a hard time getting it to work right. ... AAROn ... > FILENAME to the filename you are missing: ... >> yet one of the executables is missing. ...
    (microsoft.public.sms.admin)
  • Re: Finding missing syntax element
    ... >> Turn on use strict for starters, and use warnings. ... >> perl has no way of knowing what's really missing. ... >> is that eval needs a semicolon, but the compiler doesn't know why it ... > Semicolon is optional before the closing curly brace and it doesn't ...
    (perl.beginners)
  • RE: SMS Collection question
    ... That's too confusing, even for me and I wrote it... ... FILENAME to the filename you are missing: ... "Aaron Guilmette" wrote: ...
    (microsoft.public.sms.admin)
  • Re: Finding missing syntax element
    ... > Turn on use strict for starters, and use warnings. ... > perl has no way of knowing what's really missing. ... > actually missing a semicolon somewhere. ...
    (perl.beginners)