Solved

heredoc error message in a shell script for FTP

Posted on 2007-04-05
1
701 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

803 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