Showing posts with label ftp. Show all posts
Showing posts with label ftp. Show all posts

Wednesday, March 30, 2011

Miscellaneous Unix Commands

type two commands at a timecmd1 ; cmd2
spell check a filecat filename | spell
Reset terminal: if mistakenly viewed a binary file with catstty sane
append results of a command onto an existing filecmd>>file.ext
write results of a command to a filecmd>file.ext
logout[Ctrl]+D or exit
ftp file to host1 from host2 ftp host1
search files for a string
-# = display '#' lines on both sides
-c = display a count
-v = display non-matching lines
-i = ignore case
grep string filename

Monday, March 21, 2011

Password Variables

#! /usr/bin/ksh

echo "#------------------------------------------------------------------------------"
echo "# get passwords for the ftp and for sqlplus and assign to variables."
echo "#------------------------------------------------------------------------------"

export FTP_PASS='cat /ux123/dfact/xlt/scripts/ust_grp.password'

export SQL_PASS='cat /ux123/dfact/xlt/scripts/xlt_ods_uat.password'

echo "#------------------------------------------------------------------------------"
echo "# start ftp from vax --i: turn off prompting    n: turn off login"
echo "#------------------------------------------------------------------------------"

ftp -in host1 <
quote user ust_grp
quote pass $FTP_PASS
...
quit
EOF

echo "#------------------------------------------------------------------------------"
echo "# In SQL+, ...
echo "#------------------------------------------------------------------------------"

sqlplus -s  $SQL_PASS << EOF
.
.
exit;
EOF

Friday, March 12, 2010

FTP

#! /bin/ksh
#--------------------------------------------------
# kill the file in case nothing is found
#--------------------------------------------------
rm /ux012/lynn/vax.filelist
#--------------------------------------------------
# start ftp from vax 
#   i : turns off interactive prompting
#   n : turns off manual login
#--------------------------------------------------
ftp -in lark <<EOF
quote user ltobias
quote pass lct1234
ls ms123:[xyz]*.txt /ux012/lynn/vax.filelist
quit
EOF
#--------------------------------------------------
# after closing the ftp, display what's in the file
#--------------------------------------------------
more /ux012/lynn/vax.filelist