Welcome, Guest. Please Login
YaBB - Yet another Bulletin Board
 
  HomeHelpSearchLogin  
 
Passing bash variables to HyPhy on the command line (Read 2119 times)
SamW
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 18
Passing bash variables to HyPhy on the command line
Jan 24th, 2012 at 7:24pm
 
I was talking to my PI (Spencer) and he said there was a way to pass bash shell variables directly into HyPhy on the command line but anything I've tried has not come close to working.  For example, I am trying something along the lines of the following:

count=0
while [ $count -lt something number]
do

hyphymp ./infile [trying to pass $count into HyPhy] > outfile &

let count=$count+1
done

Any help would be greatly appreciated.

Sam
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Passing bash variables to HyPhy on the command line
Reply #1 - Jan 24th, 2012 at 8:24pm
 
Hi Sam,

Try

Code:
(echo $count) > HYPHYMP ./infile
 



in the shell script and then

Code:
fscanf (stdin, "Number", count);
 



in "infile"

Sergei
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged
 
SamW
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 18
Re: Passing bash variables to HyPhy on the command line
Reply #2 - Jan 26th, 2012 at 8:00am
 
Sergei,

Sorry to bug you about this again but I'm having trouble with this still.  I set a bash file with:

#!/bin/bash
bigcount=191
(echo $bigcount) > HYPHYMP ./null.h

and then the ./null.h with:
fscanf(stdin, "test", bigcount);
fprintf(stdout,test);

However, I keep getting an error of:

./test.sh: line 8: syntax error near unexpected token `./null.h'
./test.sh: line 8: `(echo $bigcount) > HYPHYMP ./null.h '


Does this make sense?  I'm still working on it but any help would be greatly appreciated.

Sam
Back to top
 
 
IP Logged