LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-14-2003, 03:24 AM   #1
onurbi
LQ Newbie
 
Registered: Aug 2003
Location: Munich, Germany
Distribution: Suse 8.2
Posts: 6

Rep: Reputation: 0
commands behind a bash here script


Hi,

using a here-script in a bash script prevents any command behind this from executing.

Example:

echo Connecting
echo "Trying to downoad files now..."
ftp <<**
open 192.168.0.8
get ${1%.*}.tgz
bye
**
tar xvzf ${1%.*}.tgz

The tar command will NOT be executed.

Does anybody know why? Is there a workround?

Regards, Onurbi
 
Old 11-14-2003, 07:23 AM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
Try using expect for the ftp part instead. It's very easy to use and integrate in a shell script.

Håkan
 
Old 11-14-2003, 07:38 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Properly terminate the here sequence:
ftp args address << EOF
user user pass
command
quit
EOF
echo Done.
 
Old 11-14-2003, 07:38 AM   #4
fsbooks
Member
 
Registered: Jan 2002
Location: Missoula. Montana, USA
Distribution: Slackware (various)
Posts: 464

Rep: Reputation: 52
I might have known why once, but my foggy old brain defeats me. A work around could be to have the ftp part in a separate script that is called by the main script. I know that works for me. Another approach may be using wget.
 
  


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
bash commands davatar Slackware 2 04-06-2005 03:05 AM
bash commands Obie Linux - Security 4 08-15-2004 02:42 PM
Bash commands PhuckFonix Linux - Newbie 2 03-30-2004 07:13 PM
Bash commands wprescott Linux - Distributions 6 04-27-2002 02:56 PM
Using vi commands in a bash script tiger Programming 1 05-21-2001 05:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:00 AM.

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