Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleaspera_expect
linenumberstrue
#!/usr/bin/expect
 
## set these to your dropbox id and password
set dropbox "era-drop-XX"
set pass "XXXXXXXXXXXXXX"
 
set fname [lindex $argv 0]
set files [open $fname]
set subs [read $files]

set run "[lindex $argv 1]"
set project "[lindex $argv 2]"

set direxist 0
set ident ""
 
set timeout -1

foreach line [split $subs \n] {
  if { "" != $line } {
    set seqfile [exec basename $line]
    set lst [split $line "/"]
    foreach p $lst {
      if {[regexp {[0-9][0-9][0-9]} $p]} {
        set ident $p
        puts $ident
      }
    }
 
    if { "" != $ident } {
      spawn ./ascp -QT -l80M -d $line $dropbox@webin.ebi.ac.uk:/$project/$run/$ident/.
    } else {
      spawn ./ascp -QT -l80M -d $line $dropbox@webin.ebi.ac.uk:/$project/$run/.
    }
    expect "$dropbox@fasp$dropbox@webin.era.ebi.ac.uk\'s password:"
    send "$pass\r"
    expect eof
  }
}

...