Tag Archives: PASSWD

Execution problem with the FTP shellscript

By Kannannair

Hi Friends

I am new to the shell script and i have a script which will connect to server enviornment which will read a file and will FTP to an another server location. But while executing this script FTP transfer is not occuring. But when I enter in FTP mode I am able to transfer the file from one server to another.

Script is

Code:


#!/bin/sh
FILE_NAME="/user/sba-appl/productie/sscr/ramu/dd.DAT"
HOST='130.144.240.108'
USER='user name'
PASSWD='password'
ftp -nv <<EOF
open $HOST
user $USER $PASSWD
cd /user/sba-appl/test/sscr/ramu
put $FILE_NAME
EOF


The error which I am getting is 553. The problem is I cant change the chmod permission of the target server as it is an production server. the root directory user doesnt have a write permission. But while using FTP mode I am able to write the the file but through script I am getting 553 error.Can anybody tell me how to solve this problem.Whether I can use symbolic links??. But If i am able to transfer the file using th FTP mode why it is not working with the script??

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Looping/Reading file contents not working

By DBnixUser

Hi,

I am doing something basic, but I am missing something. Im trying to read the contents of a file and taking those values and connecting to a database. However, it only connect to one (or reads in) value and then exists.

Here is what it looks like:

listname.txt

Code:

db1
db2
db3


Script:

Code:

dbcontent=/usr/home/listname.txt
echo "Enter userid"
read USERID
echo "Enter passwd:"
stty -echo
read -s PASSWD
stty echo

while read dbname;
do
#Connect to SQLPlus
sqlplus -S test/test123@$dbname
select ora_database_name from dual;
prompt my name is $USERID and my password is $PASSWD;
exit;
EOF
done < $dbcontent


It doesn’t read all the lines (loop through) just exits after one run.
I am also trying to have it connect to each database (in the list).

Source: FULL ARTICLE at The UNIX and Linux Forums