Hi,
I don't know what you mean by: "when I enter the script"
You should be running the script with a command something like:
./script -i mystudydirectory -s asubject -f somepath -o anoutputdir -m masklistfile
according to the usage message.
Are you trying to run it with a command like this?
If so, please send us the exact command that you are running and
the output that it produces.
All the best,
Mark
On 3 Aug 2011, at 16:02, Leslie Engineering wrote:
> Ok, I said it worked prematurely.
>
> Now when I type
>
> ./script
>
> i get usage details.
>
> ./script
> Usage: -i <study_dir> -s <subj_file (optional)> -f <func_path (optional)> -o <output_dir> -m <mask_list_file> or -h for help
>
> But then when I enter the script, It says
>
> script.sh: No such file or directory
>
> Does it have to be preceded by something?
>
> Again I apologize for my lack of knowledge.
>
>
>
>
> 2011/8/2 Leslie Engineering <[log in to unmask]>
> That worked!!!
>
> Thanks!
>
> You guys are best!
>
>
>
> 2011/8/2 Mark Jenkinson <[log in to unmask]>
> Hi,
>
> Try the following:
>
> cp script.txt badscript.txt
> cat badscript.txt | tr \\r \\n > script.txt
>
> but be careful to get this exactly right.
>
> This should do the same job as dos2unix (which doesn't exist on the mac).
> However, I suspect you also have an error in that the script is somehow
> looking for a file called sta1.txt which it can't find. So this may not be the
> end of your problems, but hopefully it will get rid of the one complaining
> about ^M characters.
>
> If you do get the sta1.txt error then try to find this file and put it in the
> current working directory. Or, if it is already there, this file might also contain
> characters, so try and save it as plain text and run the above commands
> to get rid of the ^M characters if that is the case (but change the file names
> appropriately).
>
> All the best,
> Mark
>
>
>
> On 2 Aug 2011, at 18:02, Leslie Engineering wrote:
>
> > So I used the same .sh script but made sure it was in plain text format (as per the format tab in textedit) and I reran find ing the same error (i.e. bash: ./sta1.txt: /bin/bash^M: bad interpreter: No such file or directory) so I tried the 'dos2unix' command, but it wasn't recognized.
> >
> > I am on a mac osx 10.6.6, by the way.
> >
> > I appreciate all the help! This forum is amazing!
> >
> >
> > On Tue, Aug 2, 2011 at 12:16 PM, Xiangzhen Kong <[log in to unmask]> wrote:
> > Maybe the command 'dos2unix' help avoiding the error 'bad interpreter: No such file or directory'.
> > bash-3.2$ chmod +x script.txt
> > bash-3.2$ dos2unix ./script.txt
> > bash-3.2$ ./script.txt
> >
> > Best!
> >
> > 2011-08-03
> > Xiangzhen Kong
> > 发件人: Leslie Engineering
> > 发送时间: 2011-08-02 22:41:33
> > 收件人: FSL
> > 抄送:
> > 主题: Re: [FSL] running a script with FSL
> > Ok, it seems this computer saves things as rich text, so I sent a file from my older computer in plain text format and cut and paste the script. Now I get the following:
> >
> > bash-3.2$ chmod +x script.txt
> > bash-3.2$ ./script.txt
> > bash: ./sta1.txt: /bin/bash^M: bad interpreter: No such file or directory
> >
> >
> > On Tue, Aug 2, 2011 at 10:31 AM, Leslie Engineering <[log in to unmask]> wrote:
> > I am not sure what you mean by plain "ascii" text editor. I opened it in TextEdit on my Mac OSX 10.6.6 and can't seem to find any other plain text applications. Do I need to download something?
> >
> >
> > On Tue, Aug 2, 2011 at 10:24 AM, wolf zinke <[log in to unmask]> wrote:
> > looks like this script was edited with a word processor and contains formating that are causing problems as ascii text file. Open this file again with a word processor, copy it into a plain ascii text editor and save t again (as plain text). Do not edit programs with a Word processor.
> >
> >
> > hope this helps,
> > wolf
> >
> >
> > Leslie Engineering wrote:
> > Sorry :)
> >
> > So this is what I get :
> >
> >
> > bash-3.2$ chmod +x script_name.sh bash-3.2$ ./script_name.sh ./sta.sh: line 1: {rtf1ansiansicpg1252cocoartf1038cocoasubrtf350: command not found
> > ./sta.sh: line 2: syntax error near unexpected token `}'
> > ./sta.sh: line 2: `{\fonttbl\f0\fswiss\fcharset0 Helvetica;}'
> >
> >
> >
> > I don't know how to interpret!
> >
> > On Tue, Aug 2, 2011 at 10:10 AM, Cunningham, Dustin <[log in to unmask] <mailto:[log in to unmask]>> wrote:
> >
> > It looks like your file is a bash shell script. I think you can
> > just give it executive privileges and run it in the terminal.
> >
> > try this:
> >
> > chmod +x filename
> > ./filename
> > ________________________________________
> > From: FSL - FMRIB's Software Library [[log in to unmask]
> > <mailto:[log in to unmask]>] On Behalf Of Leslie Engineering
> > [[log in to unmask] <mailto:[log in to unmask]>]
> >
> > Sent: Tuesday, August 02, 2011 9:27 AM
> > To: [log in to unmask] <mailto:[log in to unmask]>
> >
> > Subject: [FSL] running a script with FSL
> >
> > A colleague sent a single trial analysis script that he says "runs
> > with FSL 4.0 and above"
> >
> > How do you run a script with fsl?
> >
> > I set the path in xterm:
> >
> > export PATH="$PATH:~/scripts_folder"
> >
> > and tried to source the file
> >
> > source script_name.sh
> >
> > (clearly computers are not like the back of my hand...)
> >
> > Is there something in the fsl gui where I can automatically select
> > the script.. because I am unable to do it in the terminal prompt.
> >
> >
> >
> >
> >
>
>
|