# FT Function for Shell Scripting

**URL:** <https://forums.thehomestack.io/t/ft-function-for-shell-scripting/264>\
**Category:** Linux - General\
**Created:** [May 27, 2007, 8:01pm UTC](https://forums.thehomestack.io/t/ft-function-for-shell-scripting/264 "2007-05-27T20:01:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://forums.thehomestack.io/uploads/default/original/1X/161426793bc0d8bdf0d1a6692b3e44446861cc72.jpeg) [@system](https://forums.thehomestack.io/u/system)\
**Post date:** [May 27, 2007, 8:01pm UTC](https://forums.thehomestack.io/t/ft-function-for-shell-scripting/264/1 "2007-05-27T20:01:30Z")

</div>

Here is a good example where you can setup a script to semd out files

```auto
#!/bin/bash
set -x

HOST='web8.host.com'
USER='username''
PASSWD='password'

do_ftp_mput()
{
     ftp -d -in -i $HOST <<EOT
        user $USER $PASSWD
        cd /path/path/path
        binary
        $1
EOT
}
 
 filenames=`ls`
 put_commands=`echo "$filenames" | sed 's/^/put /'`
 echo "$put_commands"
 do_ftp_mput "$put_commands"
 
#mv $filenames path/path/path
exit 0

```
