LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-03-2006, 12:30 AM   #1
frankie_DJ
Member
 
Registered: Sep 2004
Location: NorCal
Distribution: slackware 10.1 comfy, Solaris10 learning
Posts: 232

Rep: Reputation: 30
Simple script with here document. Can't figure out what's wrong.


Hi everyone,
I am having trouble with this pretty simple script that uses here document as an input to the plotting program gnuplot.
Code:
#!/bin/sh
for i in file1 file2 file3
do
        gnuplot<<+
        set multiplot
        set xrange [0:10]
        set xrange [0:1]
        plot $i u 3:5 w linespoints
        +
done
The error that I am getting is
Code:
./plot.sh: line 11: syntax error: unexpected end of file
Can someone point me out to what is wrong here? Thanks.
 
Old 10-03-2006, 12:34 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

The end token of the here document (+ in your case). should be placed against the left border (no indentation).

Hope this helps.
 
Old 10-03-2006, 12:35 AM   #3
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
end token needs to be flush left...

Move your "+" flush left.

For better readability, you might also consider renaming it from "+" to "!" or "EOF".
 
Old 10-03-2006, 12:50 AM   #4
frankie_DJ
Member
 
Registered: Sep 2004
Location: NorCal
Distribution: slackware 10.1 comfy, Solaris10 learning
Posts: 232

Original Poster
Rep: Reputation: 30
Thank you guys very much. The book where I learned about here document doesn't really mention that.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
simple linux script gone wrong stephen_davies Linux - Newbie 1 10-27-2005 07:00 AM
C++ question: can't figure out why this simple code does not work frankie_DJ Programming 2 12-25-2004 05:14 AM
simple q: can you use php inside an html document? BrianK Programming 2 12-10-2004 10:31 PM
very very simple identd question.. cant figure out myself.. need help!! kublador Linux - Networking 1 06-10-2003 04:17 AM
retard can't figure out simple things Karnak Linux - Hardware 13 10-05-2002 01:02 PM


All times are GMT -5. The time now is 09:52 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration