Do Shell Script

I have a rather ambitious project that involves 2 telnet connections and an ftp connection.

Basically I…

  1. telnet to an IRIX box, compress a file.
  2. Ftp tp the same box and retreive the file.
  3. telnet to the box again and uncompress the file.

My script is…
rsh x.x.x.x -l
find /path/ ( -type d -name ‘.HSResource’ -prune ) -o ( -name ‘.HSancillary’ ) -o -type f -exec karc1 {} ;
ftp -i ftp://user:passwd@x.x.x.x
type binary
cd /path/
mget *
telnet x.x.x.x
/usr/etc/appletalk/kunarc -r /path/*
cd ~/Desktop/untitled
unstuff -D *

but the script only partially executes.

Can anyone help?

I’m pretty sure you’d get better and quicker input in a *nix forum, eg, Apple’s discussions groups:

You probably should be using rsync for this, as it would reduce everything you’re trying to do (as i understand it) to a single UNIX command. rsync is a UNIX tool which can connect to a remote machine, transfer files, and compress the data as it’s transported. It’s actually capable of much more than that, and can be used to bi-directionally sync complete files systems. You do need rsync on both boxes, which is generally the case for UNIX like OS’s.

See man rsync for details.

I’d recommend you use SSH for connections, if possible, as it’ll protect your data and passwords. FTP is very insecure. rsync supports SSH.