Solved

heredoc error message in a shell script for FTP

Posted on 2007-04-05
1
705 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

738 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