Closed:Need help with shell script for ftp get PATRIC bacterial sequences
1
0
Entering edit mode
5.6 years ago
bgold04 • 0

Hi,

I am having trouble getting the below to work. The standard outs I am getting from the command line are at the bottom, as is the smallarray.txt test file. I think it is a syntax thing... but I would be much obliged for your constructive comments:

#! /bin/bash
# To make a library of PATRIC .fna sequences 

cd /Users/bgold/Documents/PATRIC/

declare -a array

array=$(<smallarray.txt)

HOST='ftp.patricbrc.org'
USER='anonymous'
PASSWD='redacted@gmail.com'

#iterative part

for i in `seq 0 3`; do

VARIABLE=$i

FOLDER=${array["$VARIABLE"]}
FILE=${array["$VARIABLE"]}.fna

ftp --no-login $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD

cd /patric2/patric3/genomes

cd $FOLDER

get $FILE

quit

END_SCRIPT

exit 0

done

##commented small array below

#####smallarray.txt########
##9.107
##9.108
##9.109
##9.11

###command line complaint from my Mac
#Berts-MacBook-Pro:PATRIC bgold$ ./experimentalscript.sh
#?Invalid command
#?Invalid command
#?Invalid command
#9.107: No such file or directory
#?Invalid command
#?Invalid command
#?Invalid command
FTP arrays PATRIC microbiome shell scripts • 157 views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 1994 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6