]> Yafc Overview This manual documents Yafc. Yafc is quite a powerful ftp client. It is a console interface to the ftp protocol. If you're looking for a nice GUI client, Yafc is not for you. If you, however, use ftp often and want a fast, powerful, friendly client Yafc is here for you... Some of the features are recursive transfers, nohup transfers, colored ls, cached directory listings, autologin and bookmarks, powerful aliases and extensive tab completion. It has also support for Kerberos authentication. This manual is incomplete, and possibly out of date. If you would like to improve this manual, please send a message to . Bugs Please report bugs to . Before reporting a bug, please verify you're using the latest version (check the ftp site.) You can get the version number of your copy of yafc with the command yafc --version. When reporting bugs, please include information on what machine and operating system, including versions, you are running, an example for me to reproduce (use the --trace option) and a patch if you have one. Obtaining Yafc Yafc homepage http://yafc.sourceforge.net/ Yafc SourceForge Project Page http://sourceforge.net/projects/yafc/ Motivation Yafc was created because I needed a good ftp client. The standard BSD ftp client lacks tab completion, something I've become used to and can't live without. Of course, both Lftp and NcFtp has tab completion, but not good enough for me :-). Also, I needed a client that understood Kerberos4 authentication, because that's the security system used a KTH (The Royal Institute of Technology in Sweden, where I am studying.) But perhaps most important, I needed a fun project to work on :-) Invoking Yafc command line options Usage: yafc [options] [proto://][user[:password]@]hostname[:port][/directory] The 'proto' keyword can be either 'ftp' for ordinary FTP protocol, or 'ssh' for SSH2 protocol (sftp). Options: -a’‘--anonTry an anonymous login, ie login as "anonymous" with your email address aspassword. Your email address is first looked for in the config file(), then in the $EMAIL environment variable. If it's notfound, a guess is made from your user- and hostname. -d’‘--debugPrint all messages sent to/from server. -D’‘--dump-rcPrints the default configuration file to standard output. -m’‘--mechanism=MECHTry security mechanism MECH when logging in to the host specified on thecommand line. This will override any 'mech' options in yafcrc orbookmarks. MECH is a colon-separated string,supported values are "krb4", "krb5" and "none". The mechanisms are tried inthe order specified. -n’‘--norcDo not read the users configuration file. This will cause yafc to use itsdefault settings. -p’‘--noproxyDo not connect via the proxy. This should be used if connecting to a host onthe local network. -q’‘--quietDo not print the welcome message with copyright information when starting Yafc. -r FILE’‘--rcfile=FILERead another configuration file. -t FILE’‘--trace[=FILE]Enable creation of trace file. Trace files are mainly for debugging andincludes every response and command Yafc receives/sends. If FILE is specified,use that file instead of the default trace file(~/.yafc/trace/trace.pid, where pid is the process id number of Yafc.)Trace files can grow quite large and can safely be deleted. -u’‘--noautoDo not login automagically to the host specified on the command line. You canstill use bookmark aliases, though. -U’‘--noaliasAs —noauto, but bookmark aliases is disabled. -v’‘--verbosePrint all responses received (without response code.) -w’‘--wait=TIMEUse a different time to wait between connection attempts, in seconds.This overrides the value set by connect_wait_time in the configurationfile. -W’‘--workdir=DIRUse a different working directory for configuration files andtemporary files. Default is ~/.yafc. -V’‘--versionPrint version information on stdout and exit successfully. -h’‘--helpPrint a short help description on stdout and exit successfully. The shell Yafc presents the user with an internal shell. Command redirection is available, using the conventional shell syntax (eg cat foo.txt > foo will copy the remote file foo.txt to the local file foo.) Input redirection, however, is not supported. Also asynchronous mode is not supported. The following will thus be rejected: ls |emacs & or open < login.foo. Yafc commands All commands follow the usual GNU command line syntax, with long options starting with two dashes (‘--’). Most commands have an option ‘--help’ that shows a short syntax description. !This is a synonym for the shell () command. afslogObtain remote AFS tokens. aliasDefine an alias. bookmarkHandle bookmarks. If no options are given, the default action is to create a bookmark for the current open connection. If no bookmark name is given on the command line, the bookmark will be given an alias based upon the hostname. Usage: bookmark [options] [bookmark name ...] Options: -s[FILE]’‘--save[=FILE]Save bookmarks in memory to file. If the optional parameter FILE isomitted, save to default bookmarks file workdir/bookmarks. -e’‘--editStart editor (found in $EDITOR environment variable) with your bookmarks file. -r[FILE]’‘--read[=FILE]Read bookmarks from bookmarks file, or file given by optional parameterFILE. -d’‘--deleteDelete bookmarks given as arguments to bookmark. The bookmarks filewill be rewritten. -l’‘--listList bookmarks in memory. -u’‘--noupdateToggle the noupdate flag. If no bookmarks are specified on the commandline, only the current bookmark is affected. The bookmarks file will berewritten. -h’‘--helpShow short syntax description. cache Control the directory cache. Usage: cache [options] [directory ...] Options: -c’‘--clearClear the whole directory cache. -l’‘--listList the contents of the directory cache. -t’‘--touchRemove the specified directories from the cache. If no directories aregiven as arguments, the current directory is removed from the cache. -h’‘--helpShow a short help description. catPrint file(s) on standard output. By default, the files are transferred in ascii mode (rewriting newlines). If you want to view binary files through a filter (eg viewing a README.gz through gzip) you have to use option ‘--type=binary’. Usage: cat [options] file ... Options: -t TYPE’‘--type=TYPESet transfer type. Valid values for TYPE is ascii or binary. -h’‘--helpShow a short help description cdChange remote working directory. Usage: cd [directory] If no argument is given, cd changes to the home directory. The home directory is the current directory when logged in. If the argument is '-', cd changes to the previous working directory. cdupChanges to parent directory. On UN*X systems, this is the same as cd ... chmodChange the permission mode of remote files. Usage: chmod mode file ... Mode must be given in octal representation (for example: 0644 is -rw-r—r—). closeClose active connection. copyrightShow copyright. filetimedocumentation missing... flushdocumentation missing... fxpTransfer files from one remote server to another remote server, bypassing the client. This is done by setting up a passive mode connection on the source host and using the obtained port for an active connection on the target host. The source host is the current active host, the target host must be specified using the ‘--target=HOST’ option. This will not always work with all ftp servers, either because passive mode is not supported on the source host, or because the target refuses the given port. The target ftp server might refuse the port as a security policy. You might get the error 'Illegal PORT Command' or 'Possible port theft'. If the destination file already exists, and none of the options ‘--append’, ‘--force’, ‘--newer’, ‘--resume’, ‘--skip-existing’ or ‘--unique’ is given, you will be prompted what to do. Usage: fxp [options] file ... Options: -a’‘--appendAppend if destination exists. -D’‘--delete-afterDelete remote file after successful transfer. --dir-mask=GLOBEnter only directories matching GLOB pattern. --dir-rx-mask=REGEXPEnter only directories matching REGEXP pattern. -e’‘--skip-emptySkip empty files (files with a size of zero bytes). -f’‘--forceOverwrite existing destinations, never prompt. -H’‘--nohupTransfer files in background (nohup mode), quits yafc. -i’‘--interactivePrompt before each transfer. -L FILE’‘--logfile=FILEUse FILE as logfile instead of ~/.yafc/nohup/nohup.<pid>. -m GLOB’‘--mask=GLOBOnly transfer files matching GLOB pattern. -M REGEXP’‘--rx-mask=REGEXPOnly transfer files matching REGEXP pattern. -n’‘--newerOnly transfer file if remote is newer than local file. -o DEST’‘--output=DESTSpecify other destination. If more than one file is transferred, or option‘--recursive’ is given, DEST denotes a directory. Otherwise (if onlyone file is to be transferred), DEST denotes a filename.Examples: fxp --target=2 foo.tar.gz -o bar.tar.gz will transfer the remote file foo.tar.gz on the currently active remoteserver to the remote file bar.tar.gz on the remote server specifiedwith the ‘--target’ option (in this case the second open connection). fxp --target=funet *.tar.gz -o foo will transfer all remote *.tar.gz files to a directory namedfoo on the host specified with the ‘--target’ option (in this case'funet'). fxp -T ftp.stacken.kth.se foo -r -o bar will transfer the remote file foo to a directory named bar onftp.stacken.kth.se.If foo is a directory, it will be downloaded recursively. -p’‘--preserveTry to preserve file attributes. -P’‘--parentsAppend source path to destination. -q’‘--quietOverrides ‘--verbose’. -r’‘--recursiveTransfer directories recursively. -R’‘--resumeResume broken download (restart at EOF). -s’‘--skip-existingAlways skip existing files. -t’‘--taggedTransfer tagged files. -T HOST’‘--target=HOSTThis option is required and specifies which remote server is the target.The HOST parameter can be a complete hostname, an alias or the connectionnumber. The connection number is 1 for the first open connection, 2 for thesecond and so on. It might be useful to include that information in the promptusing the ‘%C’ code, See . --type=TYPESpecify transfer type, 'ascii' or 'binary'. -u’‘--uniqueAlways store as unique target file. -v’‘--verboseExplain what is being done. --helpShow a short syntax description. get Transfer files from remote server to local computer. If the destination file already exists, and none of the options ‘--append’, ‘--force’, ‘--newer’, ‘--resume’, ‘--skip-existing’ or ‘--unique’ is given, you will be prompted what to do. Usage: get [options] file ... Options: -a’‘--appendAppend if destination exists. -c PERM’‘--chmod=PERMChange mode of transferred files to PERM. --chgrp=GROUPchange group of transferred files to GROUP.You need to be a member of GROUP. -d’‘--no-dereferenceCopy symbolic links as symbolic links. -D’‘--delete-afterDelete remote file after successful transfer. -e’‘--skip-emptySkip empty files (files with a size of zero bytes). --dir-mask=GLOBEnter only directories matching GLOB pattern. --dir-rx-mask=REGEXPEnter only directories matching REGEXP pattern. -f’‘--forceOverwrite existing destinations, never prompt. -H’‘--nohupTransfer files in background (nohup mode), quits yafc. -i’‘--interactivePrompt before each transfer. -L FILE’‘--logfile=FILEUse FILE as logfile instead of ~/.yafc/nohup/nohup.<pid>. -m GLOB’‘--mask=GLOBOnly get files matching GLOB pattern. -M REGEXP’‘--rx-mask=REGEXPOnly get files matching REGEXP pattern. -n’‘--newerOnly get file if remote is newer than local file. -o DEST’‘--output=DESTSpecify other destination. If more than one file is transferred,option ‘--recursive’ is given, or DEST ends in a slash,then DEST denotes a directory. Otherwise (if only one file is tobe transferred), DEST denotes a filename. However, if DESTalready exists and is a directory, DEST denotes a directory.Examples: get README -o readme will transfer the remote file README to the local filereadme if readme is not an existing local directory. get README -o readme/ will transfer the remote file README to the local directoryreadme. get *.tar.gz -o foo will transfer all remote *.tar.gz files to a local directory namedfoo. get foo -r -o bar will transfer the remote file foo to a local directory named bar.If foo is a directory, it will be downloaded recursively. -p’‘--preserveTry to preserve file attributes and timestamps. -P’‘--parentsAppend source path to destination. -q’‘--quietOverrides ‘--verbose’. -r’‘--recursiveGet directories recursively. -R’‘--resumeResume broken download (restart at EOF). -s’‘--skip-existingAlways skip existing files. -t’‘--taggedTransfer tagged files. --type=TYPESpecify transfer type, 'ascii' or 'binary'. -u’‘--uniqueAlways store as unique local file. -v’‘--verboseExplain what is being done. --helpShow a short syntax description. helpShows the available commands. idleShow or set the idle timeout. kauthAuthenticate to Kerberos. kdestroyDestroy Kerberos tickets. klistShow Kerberos tickets. krbtkfileSet file used for Kerberos tickets. lcdChange local working directory. listList files. lpwdPrint local working directory. lsList files. Usage: ls [options] [files ...] Options: -a’‘--allDo not hide entries starting with '.'. -A’‘--almost-allAs ‘--all’, but do not list . and .. -B’‘--ignore-backupsDo not list implied entries ending with ~. -CList entries by columns. --color[=WHEN]Control whether color is used to distinguish file types. WHEN may beeither never, always or auto. If WHEN is not given,default is always. If the argument is auto, colors will be usedonly if output is bound to a tty. -d’‘--directoryList directory entries instead of contents. --dirs-firstShow directories first (last with ‘--reverse’). -F’‘--classifyAppend a character for typing each entry. -gIgnored. -G’‘--no-groupInhibit display of group information. -h’‘--human-readablePrint sizes in human readable format (e.g. 1K, 234M, 2G) -lUse a long listing format. -N’‘--literalPrint raw entry names (don't treat control characters specially) -oUse a long listing format without group info. Same as ‘-lG’. -r’‘--reverseReverse order while sorting. -R’‘--recursiveList subdirectories recursively. -SSort by file size -tSort by modification time. -UDo not sort; list entries in directory order. -xList entries by lines instead of by columns. -XSort alphabetically by entry extension. -1List one file per line. --helpShow a short syntax description. ltagTag local files. luntagUntag local files. mkdirCreates a remote directory (requires proper permissions.) Usage: mkdir directory mvDocumentation missing... nlistDocumentation missing... nopSend a NOOP command to remote host. This does nothing except checking if the connection is still open. It may be used to reset the servers idle timeout (though some servers ignore it). open Opens a new connection to an FTP/SSH server. Usage: open [options] [proto://][user[:password]@]hostname[:port][/directory] ... proto can be either 'ftp' or 'ssh' ('sftp' is an alias for 'ssh') Options: -a’‘--anonTry to login anonymously. -u’‘--noautoDisable autologin. -U’‘--noaliasDisable bookmark alias lookup and abbreviation. -m MECH’‘--mechanism=MECHTry security mechanism MECH when logging in. This will override any'mech' options in yafcrc or bookmarks. MECH is acolon-separated string, supported values are "krb4", "krb5" and "none". Themechanisms are tried in the order specified. -s PATH’‘--sftp=PATHSpecify path to the remote sftp-server program. SSH starts thisprogram on the remote side when initiating an sftp connection. Thisoption is only necessary if the remote ssh server doesn't understandthe sftp subsystem.Specify ‘--sftp=""’ to disable the sftp-server path, and use sftpsubsystem instead.If you don't know the remote path to the sftp-server program, thedefault for OpenSSH is /usr/libexec/sftp-server. Another commonpath is /usr/bin/sftp-server. --helpShow a short syntax description. prot Changes the data protection level for data transfers. The protection level defines how data transfers are handled by the security mechanism. Usage: prot [options] [command | data] protlevel Options: -h’‘--helpShow short syntax description. Valid protection levels are: clear no data protection safe integrity check private all data encrypted and integrity checked putSend files to remote computer. If the destination file already exists, and none of the options ‘--append’, ‘--force’, ‘--newer’, ‘--resume’, ‘--skip-existing’ or ‘--unique’ is given, you will be prompted what to do. Usage: put [options] file ... Options: -a’‘--appendAppend if destination file exists. -D’‘--delete-afterDelete local file after successful transfer. --dir-mask=GLOBEnter only directories matching GLOB pattern. --dir-rx-mask=REGEXPEnter only directories matching REGEXP pattern. -e’‘--skip-emptySkip empty files (files with a size of zero bytes). -f’‘--forceOverwrite existing destinations, never prompt. -H’‘--nohupTransfer files in background (nohup mode), quits yafc. -i’‘--interactivePrompt before transferring each file. -L FILE’‘--logfile=FILEUse FILE as logfile instead of ~/.yafc/nohup/nohup.<pid> fornohup transfers. -m GLOB’‘--mask=GLOBOnly put files matching GLOB pattern. -M REGEXP’‘--rx-mask=REGEXPOnly put files matching REGEXP pattern. -n’‘--newerOnly transfer file if local is newer than remote file. -o DEST’‘--output=DESTSpecify other destination. If more than one file is transferred, or option‘--recursive’ is given, DEST denotes a directory. Otherwise (if onlyone file is to be transferred), DEST denotes a filename.Examples: put foo.tar.gz -o bar.tar.gz will transfer the local file foo.tar.gz to the remote filebar.tar.gz. put *.tar.gz -o foo will transfer all local *.tar.gz files to a remote directory namedfoo. put foo -r -o bar will transfer the local file foo to a remote directory named bar.If foo is a directory, it will be uploaded recursively. -p’‘--preserveTry to preserve file attributes (permissions). -P’‘--parentsAppend source path to destination. -q’‘--quietOverrides ‘--verbose’. -r’‘--recursiveUpload directories recursively. -R’‘--resumeResume broken transfer (restart at EOF). -s’‘--skip-existingAlways skip existing files. -t’‘--taggedTransfer (locally) tagged files. --type=TYPESpecify transfer type, 'ascii' or 'binary'. -u’‘--uniqueAlways store as unique file (if server supports the STOU command). -v’‘--verboseExplain what is being done. --helpShow a short syntax description. pwd Prints the current remote working directory. Usage: pwd quitdocumentation missing... quotedocumentation missing... reopen Reopen a timed out connection. rhelpdocumentation missing... rm Remove files on remote server. Usage: rm [options] file... Options: -f’‘--forcenever prompt -i’‘--interactiveprompt before any removal -r’‘--recursiveremove the contents of directories recursively. CAREFUL! -t’‘--taggedremove tagged files -v’‘--verboseexplain what is being done --helpdisplay help rmdirdocumentation missing... rstatusdocumentation missing... setdocumentation missing... shelldocumentation missing... siteSend site specific command. Usage: site command Try site help or rhelp site for more information sourcedocumentation missing... statusdocumentation missing... switchSwitch between open connections. Usage: switch [options] [connection] Options: -h’‘--helpShow short syntax description. The connection argument specifies which connection to switch to. It can be specified either as the connection number or with the name (hostname or alias). If no argument is given, switch to the next open connection. systemShow the type of the remote system. tagTag files for later transferring or removal. Usage: tag [options] file ... Options: -c’‘--clearClear the taglist. -i’‘--infoShow some information about the tagged files. This includes the totalsize of all tagged file, how many files and how many directories are tagged. -l’‘--listList tagged files. -L[FILE]’‘--load[=FILE]Load saved taglist file. If optional parameter FILE is omitted, thetaglist for this host is loaded (from the fileworkdir/taglist.hostname). -s[FILE]’‘--save[=FILE]Save taglist to file. If optional parameter fILE is omitted, thetaglist is saved in the default fileworkdir/taglist.hostname. -h’‘--helpShow short syntax description. unaliasdocumentation missing... untagdocumentation missing... urlShow the current URL. Usage: url [options] Options: -e’‘--no-encodingDon't encode the URL as RFC1738 says. -h’‘--helpShow short syntax description. userSend new user information. versiondocumentation missing... warrantydocumentation missing... Nohup transfers get and put has an option ‘--nohup’. When given, Yafc will fork itself to the background and continue to transfer the specified files, allowing you to use your shell or even logout. Output is redirected to the file ~/.yafc/nohup/nohup.pid, or to file specified by option ‘--logfile=FILE’. If you have tagged any files (with the tag command, see ), add the option ‘--tagged’ to the get command to transfer those files too. There is an equivalent command for local files and put, namely ltag. Yafc will also enter nohup mode upon receipt of SIGHUP. Set nohup_mailaddress in the yafcrc file to a valid mail address if you want to receive a mail notifying you when the transfer is complete. Configuration Yafc will parse a system-wide configuration file, /etc/yafcrc (or whatever you set with the ‘--sysconfdir’ option to the configure script), first. Then, personal settings are read from ~/.yafc/yafcrc (overriding the global ones). If none of those files exists, internal defaults will be used. The ‘--dump-rc’ option of Yafc can be used to dump the default configuration file to standard output. You can create your own config file with the command yafc --dump-rc > ~/.yafc/yafcrc. You can customize it with your favourite editor, it should be quite self-explaining if you read the comments. Yafc also looks for ~/.netrc, and reads autologin information from that file. This file is also used by the standard ftp client. Yafc uses the Readline library to read commands from the terminal, and Readline can be configured via the ~/.inputrc file. In this file you can put keybindings and Readline-oriented options. You can use $yafc for conditional parsing of the ~/.inputrc file. A sample inputrc file is included in the distribution. Keywords The configuration file consists of keywords with an argument, separated with a space. There are three types of arguments: strings, booleans and integers. Strings must be enclosed in quotes if they contains spaces. Boolean arguments can be written as 0/1, true/false or on/off. The keywords are case insensitive. These are the supported keywords: anon_password type: stringThis is the password used for anonymous logins. It should be your emailaddress. autologin type: booleanSetting this to true will cause yafc to attempt to loginautomatically. Information for doing this is specified bySee . autoreconnect type: booleanIf this option is true, yafc will try to reconnect the currently openconnection if it has timed out. The directory cache is retained aftera successful reconnect. quit_on_eof type: booleanQuits yafc on end-of-file (usually Ctrl-D). read_netrc type: booleanRead additional autologin entries from ~/.netrc.. use_passive_mode type: booleanIf true, use passive mode data connections. You might have to do thisif you are behind a proxy. reverse_dns type: booleanIf this option is true, IP addresses will be reverse looked up in theDNS for a hostname, which can be slow. Set to false to skip this. waiting_dots type: booleanIf this option is true, filenames will be completed with ... whilewaiting for the directory listing to be downloaded. cache_timeout type: integerTime (in seconds) before a cached directory times out and needs to bereread. Set to 0 (zero) to disable the timeout. verbose type: booleanShow all replies received from remote host. debug type: booleanShow exactly what is going on. Prints all FTP commands sent to remotehost and all replies received, including response code. trace type: stringCreate trace files in ~/.yafc/trace/trace.<pid>. ssh_program type: stringPath to local ssh program which will be used in SSH2 connections. Notethat only SSH version 2 is supported. ssh_options type: stringCustom options that will be passed to the SSH program. sftp_server_program type: stringPath to remote sftp-server program. Leave commented to use the sftpsubsystem. See also . inhibit_startup_syst type: booleanSet to true to skip query of remote system on connect. use_env_string type: booleanAlter the environment strings to reflect what Yafc is doing.This information can be seen with the shell command ps. remote_completion type: booleanUse tab to complete remote files. Yeahh. auto_bookmark type: yes/no/askIf set to yes, Yafc automatically creates a bookmarks for thesite when the connection is closed. Setting this to ask, makesyafc ask if to create the bookmark.The bookmark is given an appropriate default aliases name. auto_bookmark_update type: yes/no/askIf set to yes, yafc will always update an existing bookmarkwhen the connection is closed, if not the noupdate flag hasbeen set, see the noupdate keyword in See . auto_bookmark_save_password type: booleanIf set to yes, Yafc don't ask whether to save passwordsin the bookmarks file. Anonymous password, though, are always saved.Passwords in the bookmarks file are stored either as clear textor base64-encoded. Be sure the file is not world readable (chmod 0600 bookmarks.) auto_bookmark_silent type: booleanIf set to true, Yafc won't say anything about automatically createdbookmarks. default_type type: stringSpecifies the default type used for file transfers, eitherbinary or ascii. Setting this to asciican mess up binary files (ascii mode rewrites the end-of-line characters). default_mechanism type: stringThis option specifies which security mechanisms to try, in given order.It is a colon-separated string, supported values are "krb4", "krb5" and "none".Example: default_mechanism "krb4:krb5" ascii_transfer_mask type: stringFilenames matching any of these filemasks are alwaystransferred in ascii mode, regardless of the value ofthe default_type keyword. This can be overridden withthe ‘--type’ option to get/put.Masks are separated by colons (eg. *.ext1:*.ext2:filename*)and are case sensitive. This option can be specified multiple times;masks will be appended.Preferrably used with default_type set to binary. transfer_first_mask type: stringFilenames matching any of these masks are transferred before otherfiles.Masks are separated by colons (eg. *.sfv:*.nfo:README*:md5sum*)and are case sensitive. This option can be specified multiple times;masks will be appended. beep_after_long_command type: booleanBeep after a long command is finished. Use long_command_timeto specify how long a ‘long’ command is. long_command_time type: integerNumber of seconds for command to become ‘long command_timeout type: integerHow long (in seconds) before aborting a command without response. connection_timeout type: integerHow long (in seconds) before aborting a connection without response. connect_attempts type: integerNumber of times to try to re-connect if login failed (due to busy server.)Use the value -1 for unlimited number of tries, and 0 to disable this feature. connect_wait_time type: integerNumber of seconds to wait between connection attempts. use_history type: booleanSave and load history lines in ~/.yafc/history.This is a no-op if not compiled with Readline. history_max type: integerMax number of history lines to save in the history file.This is a no-op if not compiled with Readline. startup_local_directory type: stringYafc will change to this (local) directory upon startup. nohup_mailaddress type: stringIf set, Yafc sends mail to this address when nohup transfers are finished.. sendmail_path type: stringComplete path to sendmail used by ‘nohup_mailaddress’ above. prompt1 type: stringThis prompt is printed when no connection is established.See .You can put escape codes here, for example if you want a colored prompt"%{\e[01;31m%}ftp%{\e[0m%}" will be "ftp" in red, if your terminal supportsISO 6429 (ANSI) color codes. . prompt2 type: stringconnected but not logged in. prompt3 type: stringconnected and logged in transfer_begin_string type: stringThis string is printed before the actual transfer begins.These strings are printed with the ‘--verbose’ option to get/put. for special character codes that can be used inthis string to show dynamic information. transfer_string type: stringThis string is printed (approx.) every second or so during the transferwith a trailing carriage return. for special character codes that can be used inthis string to show dynamic information. transfer_end_string type: stringThis string is printed when the transfer is finished. for special character codes that can be used inthis string to show dynamic information. transfer_xterm_string type: stringThis string is printed at the same time ‘transfer_string’ is printed,if the current $TERM variable is defined in ‘xterm_title_terms’. Thisstring can be used to reflect dynamic information about the current transferin the title bar of an Xterm. for special character codes that can be used inthis string to show dynamic information. tilde type: booleanDisplay ~ instead of full home directory path for various commands. xterm_title1 type: stringXterm window titlessame codes as for the prompts, see See .This is an excerpt from the Xterm-title mini-HOWTO: Many people find it useful to set the title of a terminal to reflect dynamic information, such as the name of the host the user is logged into, the current working directory, etc. This may be done by using XTerm escape sequences. The following sequences are useful in this respect: ESC]0;_string_BELSet icon name and window title to _string_ ESC]1;_string_BELSet icon name to _string_ ESC]2;_string_BELSet window title to _string_ where ESC is the _escape_ character (\033), and BEL is the _bell_ character (\007). _Note_: these sequences apply to most xterm derivatives, such as nxterm, color-xterm and rxvt. Other terminal types often use different escapes; see the appendix for examples. For the full list of xterm escape sequences see the file ctlseq2.txt, which comes with the xterm distribution, or xterm.seq, which comes with the rxvt distribution. These escapes really need to be applied every time the prompt changes. This way the string is updated with every command you issue and can keep track of information such as current working directory, username, hostname, etc. Example: xterm_title1 "\e]0;Yafc\x07" sets the xterm window title andicon name to Yafc. xterm_title2 type: stringExample: xterm_title1 "\e]0:Yafc - %h\x07" sets the xterm window titleand icon name to Yafc - hostname. xterm_title3 type: stringExample: xterm_title1 "\e]0;Yafc - %u@%h:%~\x07" sets the xterm windowtitle and icon name to Yafc - user@hostname:directory. xterm_title_terms type: stringList of $TERM's, separated with spaces, which can handle xtermescape sequences. Prompt codes These codes can be used in the prompts, , to reflect dynamic information. For all codes, there may be an optional minimum field width. This is an integer between the '%' and the code character. %uusername %hremote host name (as passed to open) %H%h up to the first '.' %mremote machine name (as returned by gethostbyname) %M%m up to the first '.' %nremote IP number %wcurrent remote working directory %Wbasename of %w %~as %w but home directory is replaced with ~ %lcurrent local working directory %Lbasename of %l %cTotal number of connections open %CThe number of the currently active connection %%a percent sign %#a '#' if (local) user is root, else '$' %{begin sequence of non-printing chars, ie escape codes %}end sequence of non-printing chars, ie escape codes \ean escape character (hex 0x1B) \na newline \ta tab character \ra carriage return \x##character 0x## (hex) Example: prompt3 "(%C) %{\e[1%}myafc%{\e[0m%} %u@%h:%42~> " Transfer codes These codes can be used in the transfer strings. For all codes, there may be an optional minimum field width. This is an integer between the '%' and the code character. For example will %17v be expanded to a visual progress bar with length 17. If the field width if negative (start with a minus), the string is left-justified, so using %-20S will show the total size, padded with spaces to 20 characters. %rsource filename %Rsource filename w/path %ltarget filename %Ltarget filename w/path %ssize transferred so far %Stotal size (if available) %eETA (time left) %ppercent transferred so far %%percent sign %btransfer rate (Bps) %Btransfer rate (Bps) or "stalled" if stalled %ttime elapsed %vvisual progress bar Example: transfer_string "%5p%% [%{\e[32m%}%25v%{\e[0m%}] %s/%S ETA %{\e[32m%}%e%{\e[0m%} %B" Aliases Just like in the shell, you can create aliases for commands you use often, with options you like. Aliases can be defined in the configuration file or directly on the command line. Aliases defined on the command line are only valid in the current session. . The best way to explain aliases, I think, is to look at some examples: Alias examples alias ls "ls -F --color"Override the command ls to be expanded to ls -F --color.Any arguments given to the new ls alias will be appended. alias ll "ls -l"ll will be expanded to ls -l, regardless if there is analias for plain ls like the one above. Aliases can't be nested. alias ls listOverride the command ls to be expanded to the command list.This is fine, but will generate a warning;warning: alias 'ls' shadows a command with the same name,because the original command ls is lost and can't be referenced (exceptthrough another alias.) alias pls "ls %1 | less"Create a new command pls, which lists the contents of a directory andpages it through the pager less. The %1 keyword is replaced withthe first argument to pls, any other arguments will be appended at theend (to the local less command.) alias pls "ls %* | $PAGER"Create a new command pls, which lists the contents of a directory andpages it through your favourite pager. Any arguments given to pls willbe inserted between ls and the pipe because of the %* keyword. Using$PAGER is fine, it is expanded by the ordinary shell. alias rels "cache --touch %*; ls -F --color %*"Create a new command rels, which flushes the directories fromthe cache before listing them. Two %* sequences are needed toinsert the arguments at both places. Colors Escape codes can be used to display colors in the transfer strings and the prompts. All escape codes must be surrounded by %{ and %} pairs for readline to correctly wrap long lines. The built-in command ls has an option ‘--color’. You must set the environment variable LS_COLORS (or LS_COLOURS) for this to work. See manpage for GNU ls(1) and *note dircolors: (fileutils)dircolors invocation, for information how to do this. If you don't set LS_COLO[U]RS, you can still use the ‘--color’ option, since Yafc provides some default settings. ANSI attribute codes An ANSI escape sequence has the format ESC[X;Ym, where ESC is the escape character (octal 033). X and, optionally, Y, is one of the following escape codes: attribute codes 00 = none 01 = bold 04 = underscore 05 = blink 07 = reverse 08 = concealed text color codes 30 = black 31 = red 32 = green 33 = yellow 34 = blue 35 = magenta 36 = cyan 37 = white background color codes 40 = black 41 = red 42 = green 43 = yellow 44 = blue 45 = magenta 46 = cyan 47 = white For example, the sequence ESC[1;32myafc rulesESC[0m will be the string yafc rules in bright green, after which the attribute is restored to normal. Bookmarks Just like creating bookmarks for web pages in a browser, you can create bookmarks for ftp sites in Yafc. These can later be used for autologin to that site. When connected to an ftp site, use the bookmark command () to create a bookmark for that site. If you logged in with a username and password, Yafc will ask if you want to save the password in the bookmarks file. If you do, be sure it isn't world readable. By using the auto_bookmark keyword in the configuration file, Yafc can create bookmarks automatically for new sites. The bookmarks are available to the open command, with tab completion. You can also specify a bookmark name/alias on the command line when starting yafc. Bookmark names/aliases can be abbreviated, as long as it isn't ambiguous. The autologin information is stored in much the same way as in the ~/.netrc file used by standard ftp(1), except that the macdef option is not supported. An entry must begin with a machine, default or local keyword. Bookmark keywords machineSpecify the hostname to connect to or a domainname. The hostnamecan be a valid FTP URL, including username, password, etc. In that casethere is no need to specify the corresponding keywords. Using the URL syntaxis the only way to specify a non-standard port.Domainnames should begin with a period, as in .kth.se. This will matchany hostname on that domain, except for hostnames explicitly mentioned withanother ‘machine’ keyword.You can not specify an alias name for a domain entry.To bookmark a ssh connection, use ssh://hostname orsftp://hostname (they are equivalent). aliasSpecifies another (verbose) name for the bookmark, like ‘ruby’ instead of‘ftp.netlab.co.jp’. This is the name that will be shownin the tab completion list. Valid only after a ‘machine’ statement. localIf an entry begins with ‘local’, it specifies how to login to alllocal machines. Local machines are unqualified hostnames (ie,hostnames without a period.)This can be overridden with an entry for a specific machine. defaultThe ‘default’ entry is used when no other ‘machine’or ‘local’ keyword matched. It can be used to login anonymouslyto all unknown sites. loginSpecify the username. anonymousTry an anonymous login, uses anon_password. passwordSpecify the password, if required. accountSpecify account name. Not fully supported, anyone using it? cwdThis keyword specifies a startup directory on the remote server.Yafc changes the current directory when logged in. protThe prot keyword sets the Kerberos data protection level.Valid protection levels are safe, clear and private.This is a no-op if not compiled with Kerberos. mechList the preferred security mechanisms to use. This is the same asdefault_mechanism, except it is only used for this machine. passiveBoolean option requiring an argument (true/false). If true, use passivemode in data transfers, regardless of the value of use_passive_modein the configuration file. noupdateIf this keyword is specified, the bookmark will not be updated when aconnection is closed. The noupdate flag can be toogled with thecommand See . Bookmark examples default login anonymous As default, login as 'anonymous' and prompt for password default anonymous As default, login as 'anonymous' and automatically supply your emailaddress as password. local login mhe Login as 'mhe' on all machines on the local network (machines w/o a '.') machine .foo.bar.se login niels Login as 'niels' on all hosts on .foo.bar.se domain machine dent.foo.bar.se login slartibartfast cwd ~/fjord Login as 'slartibartfast' on dent.foo.bar.se and start in directory ~/fjord machine slartibartfast@dent.foo.bar.se/fjord Identical to the example above, but using an ftp URL instead machine ftp.gurka.com:4711 anonymous Login as 'anonymous' and automagically supply password fromanon_password, connect on non-standard port 4711 machine mayer.physto.se anonymous cwd /pub/yafc alias yafc Login anonymously to machine mayer.physto.se with other name yafc machine shell.stacken.kth.se login mhe mech krb4 passive yes alias stacken Login as mhe using Kerberos 4 authentication, and use passive mode fortransfers (overrides the use_passive_mode keyword in the config file) Kerberos If Yafc is compiled with Kerberos, it tries to authenticate using Kerberos 4/5 without sending the password in cleartext. For anonymous logins, Kerberos is never used. The default protection level for data connections is clear, ie no encryption on transfers. Use the command prot (), to change the data protection level. Valid arguments are clear, safe, and private. Note that confidential protection is not supported in Kerberos 4. You can use the ‘prot’ keyword (see ) in the bookmarks file to automagically set the protection level for a specific host.