Solved

heredoc error message in a shell script for FTP

Posted on 2007-04-05
1
699 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
ID: 18862432
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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

861 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

20 Experts available now in Live!

Get 1:1 Help Now