Solved

heredoc error message in a shell script for FTP

Posted on 2007-04-05
1
697 Views
Last Modified: 2013-12-16
Hello,

When I try to execute the following shell script:

#!/bin/sh
HOST='ftp.yourdomain.com'
USER='yourid'
PASSWD='yourpw'
FILE='file.txt'

ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
ascii
get $FILE
quit
END_SCRIPT
exit 0

I receive this error message:

./my_script_name: line 7: cannot create temp file for here document: No space left on device

Line 7 is where the here doc begins with this string: <<END_SCRIPT

I know that I have sufficient space on the server from which I am running the script. What else should I look at to get it to work? I have, of course, substituted the values for HOST, USER, PASSWD, and FILE to my actual values and if I interactively FTP from the shell, I have not problem FTP-ing and getting the file.
0
Comment
Question by:mdichirico
1 Comment
 
LVL 8

Accepted Solution

by:
frashii earned 125 total points
Comment Utility
Do you have permission to write to /tmp ? Or is that full ?

Sometimes people set /tmp to be read only for certain things, and sometimes /tmp is set to be non-execute which would cause these kinds of problems.

Try:

mount   (to check the permissions)
ls -ald /tmp
and
df -h (to check the space)
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Creating an OSPF network that automatically (dynamically) reroutes network traffic over other connections to prevent network downtime.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now