NERSCPowering Scientific Discovery Since 1974

PFTP Shell Script

This example shows a batch script with pftp actions in it.  The use of both single and multiple-file movement commands as well as directory change commands are shown.  We also show the "+" character used to bracket a "here document".  This example assumes that you have a ".netrc" file in your home directory with the appropriate encrypted password.  See HPSS Paswords.

#!/bin/csh
# First, copy the source from the submitting directory
pftp -i -v archive <<+
cd my_HPSS_directory
mget data*
get source.f
quite
+

./myprog data outfile

# Save the output file in HPSS.
pftp -i -v archive <<+
cd my_HPSS_directory
put outfile
mput restart*
quite
+
exit