script problem can't read thru EOF [message #275265] |
Fri, 19 October 2007 02:10  |
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 #275273 is a reply to message #275265] |
Fri, 19 October 2007 02:25   |
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.
|
|
|
|