Mercurial > hg > paul
comparison bin/toE @ 0:2aa53823fb21
new repo
| author | Henry S. Thompson <ht@inf.ed.ac.uk> |
|---|---|
| date | Sat, 06 Jun 2026 10:19:04 +0100 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:2aa53823fb21 |
|---|---|
| 1 #!/bin/bash | |
| 2 # If one arg't, send to home dir of Edinburgh desktop machine | |
| 3 # If more than one, send all but last to last, which must be a directory (or . for $HOME) | |
| 4 # To rename remote file do toE local -r remote [dir] | |
| 5 if [ "x$2" = "x" ]; then | |
| 6 : | |
| 7 else | |
| 8 dir=${!#} | |
| 9 set -- "${@: 1: $#-1}" | |
| 10 if [ "$dir" = "." ]; then | |
| 11 unset dir | |
| 12 fi | |
| 13 fi | |
| 14 echo xcp "$@" "$DESKTOP:$dir" | |
| 15 xcp "$@" "$DESKTOP:$dir" | |
| 16 exit 0 | |
| 17 | |
| 18 # Older version follows | |
| 19 ff= | |
| 20 if [ "x$2" = "x" ] | |
| 21 then | |
| 22 dest="$DESKTOP:" | |
| 23 ff="'$1'" | |
| 24 else | |
| 25 while [ "x$2" != "x" ] | |
| 26 do | |
| 27 ff="$ff '$1'" | |
| 28 shift | |
| 29 done | |
| 30 dest="'$DESKTOP:$1'" | |
| 31 fi | |
| 32 echo scp $ff $dest | |
| 33 sh -c "scp $ff $dest" |
