ex72.sh
来自「Shall高级编程」· Shell 代码 · 共 42 行
SH
42 行
#!/bin/bash# upload.sh# Upload file pair (Filename.lsm, Filename.tar.gz)#+ to incoming directory at Sunsite/UNC (ibiblio.org).# Filename.tar.gz is the tarball itself.# Filename.lsm is the descriptor file.# Sunsite requires "lsm" file, otherwise will bounce contributions.E_ARGERROR=65if [ -z "$1" ]then echo "Usage: `basename $0` Filename-to-upload" exit $E_ARGERRORfi Filename=`basename $1` # Strips pathname out of file name.Server="ibiblio.org"Directory="/incoming/Linux"# These need not be hard-coded into script,#+ but may instead be changed to command line argument.Password="your.e-mail.address" # Change above to suit.ftp -n $Server <<End-Of-Session# -n option disables auto-logonuser anonymous "$Password"binarybell # Ring 'bell' after each file transfer.cd $Directoryput "$Filename.lsm"put "$Filename.tar.gz"byeEnd-Of-Sessionexit 0
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?