LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-30-2005, 06:02 PM   #1
Kamikazee
Member
 
Registered: May 2005
Location: Aus
Distribution: SimplyMEPIS 3.3
Posts: 107

Rep: Reputation: 15
Passing parameters to bash script


Ive set up the following ftp script. (called FTP)

Code:
#!/bin/sh
HOST='MyHost'
USER='MyUser'
PASSWD='MyPassword'
FILE= $1

ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
put $FILE
quit
END_SCRIPT
exit 0
however, when i run it with - ./FTP screen.jpg
the screen.jpg file is in the working directory at the time but it outputs

./FTP: line 5: Screen1.jpg: command not found
(local-file) (remote-file)


Any ideas?
 
Old 09-30-2005, 06:08 PM   #2
Thinking
Member
 
Registered: Oct 2003
Posts: 249

Rep: Reputation: 30
i'm not sure but try this one

./FTP ./screen.jpg

greetz
 
Old 09-30-2005, 06:28 PM   #3
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Code:
FILE= $1
Bash is very particular about spaces. Give it a shot without the space between the '=' and '$'
 
Old 09-30-2005, 06:46 PM   #4
Kamikazee
Member
 
Registered: May 2005
Location: Aus
Distribution: SimplyMEPIS 3.3
Posts: 107

Original Poster
Rep: Reputation: 15
Thanks Dark_Helmet. You were spot on.
 
Old 10-01-2005, 06:41 AM   #5
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
you can use $HOME/.netrc file to automate ftp transactions

man netrc
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing parameters to a shell script neocookie Linux - General 5 10-20-2005 11:44 AM
passing parameters to functions in shell script kushalkoolwal Programming 1 09-28-2005 02:40 PM
Bash Script Passing variable to Function nutthick Programming 2 02-02-2005 05:15 AM
Passing Parameters to Bash Script mooreted Linux - Software 3 04-05-2004 09:08 PM
passing java parameters to a unix script nephilim Programming 25 10-22-2003 10:51 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration