Home » Infrastructure » Unix » script problem can't read thru EOF
script problem can't read thru EOF [message #275265] Fri, 19 October 2007 02:10 Go to next message
KARINC
Messages: 3
Registered: October 2007
Junior Member
This simple script worked in 1 env but didn't work in another.
Problem is it can't produce the file as it can't read thru EOF. Why and how to fix it?
cat >> $out_file <<-EOF
first line of data
second line of data
more data
the end of the data
EOF

Re: script problem can't read thru EOF [message #275266 is a reply to message #275265] Fri, 19 October 2007 02:14 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Can you precise your problem and question. Maybe with an example.

Regards
Michel
Re: script problem can't read thru EOF [message #275273 is a reply to message #275265] Fri, 19 October 2007 02:25 Go to previous messageGo to next message
KARINC
Messages: 3
Registered: October 2007
Junior Member
I think it's the env problem but don't know what and how to fix it.

I created a simple a.sh:

>cat a.sh
cat >> abc.output <<-EOF
first line of data
second line of data
more data
the end of the data
EOF

After ran it:
> a.sh
supposed to have a file containing 4 lines but it's empty:

>ls -ltr abc.output
-rw------- 1 p1332 staff 0 Oct 19 17:22 abc.output

I was actually trying to run sqlplus like:
sqlplus scott/tiger << EOF
select sysdate from dual;
EOF

As it won't read thru between EOF as well.
Re: script problem can't read thru EOF [message #275275 is a reply to message #275265] Fri, 19 October 2007 02:45 Go to previous message
KARINC
Messages: 3
Registered: October 2007
Junior Member
Found the cause. The /tmp was 100% FULL !!!!!! Thanks Michel.
Previous Topic: find command
Next Topic: Solaris10 update
Goto Forum:
  


Current Time: Fri Dec 09 23:13:43 CST 2016

Total time taken to generate the page: 0.15475 seconds