The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
su (switching to other user) bjagadeesh Shell Programming and Scripting 2 05-21-2008 05:51 AM
su (switching to other user) bjagadeesh Shell Programming and Scripting 1 05-20-2008 11:27 AM
switching to another user in shell script... bjagadeesh Shell Programming and Scripting 1 02-28-2008 07:10 AM
switching user from root to ordinary user sasia Shell Programming and Scripting 3 01-25-2008 10:25 PM
Switching to single-user mode gmoyano UNIX for Dummies Questions & Answers 1 08-05-2002 10:50 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-05-2007
daveaasmith daveaasmith is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 13
FTP - switching user syntax

Running the following shell script,

#!/usr/bin/ksh
set -x
swdofile=/opt/SWDO_IN1V01P001_1.csv
USER='myusername'
PASSWD='mypassword'
HOST='myhostname'
ftp -n $HOST << SCRIPT
quote USER $USER
quote PASS $PASSWD
su - BRA -c put $swdofile
quit
SCRIPT
exit 0

but not managing to get the file PUT via FTP... Think it might be a problem with the SU statement, as although the file is being found (well, it's not complaining!), the output I am getting is

+ swdofile=/opt/SWDO_IN1V01P001_1.csv
+ USER=myusername
+ PASSWD=mypassword
+ HOST=myhostname
quote USER myusername
quote PASS mypassword
su - BRA -c put /opt/SWDO_IN1V01P001_1.csv
quit
Store unique on.
?Invalid command
+ exit 0

Any ideas ???

Dave.
  #2 (permalink)  
Old 09-05-2007
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Whatever you are doing after the "ftp -n $HOST << SCRIPT" line will be interpreted by the ftp command till the "SCRIPT" token is encountered. If you do need to su to any user, run the ftp command after you su (with -c).
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:53 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0