Writing ftp macros

These steps describe how to create an ftp macro.

You must have created the $HOME/.netrc file.

To write an ftp macro:

  1. Edit the $HOME/.netrc file to include the following instructions:
    
    macdef init
    put schedule

    Be sure to insert a blank line at the end of your ftp macro. The blank line terminates the ftp macro. In the above example, the macdef subcommand defines the subcommand macro init. The line following is the command the macro specifies, in this case put schedule, where schedule is the name of a file.

  2. After you create the ftp macro, at the command line prompt, type:
    ftp 
    hostname
    

    Where hostname is the name of the host to which you are connecting.

    ftp scans the $HOME/.netrc file for a login definition matching your host name and uses that login definition to log you in.
  3. After you log in, at the command line prompt, type:
    ftp init

    In this example, ftp scans for the macro named init and executes the command or commands the macro specifies.

    An ftp macro is associated with the login entry immediately preceding it. ftp macros are not global to the $HOME/.netrc file. The macro init is executed automatically upon login. Other macros can be executed from the ftp prompt ( ftp>) by typing the following:
    $getit

    In this example, the $ executes the ftp macro getit.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值