EOF creating problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting EOF creating problem
# 1  
Old 07-04-2008
EOF creating problem

In shell file, i am writing following statement:

cat > File1.sh <<EOF

set feedback off
set serveroutput on

cat > File2.sh <<EOF
contents of second file
EOF
Contents of First file

EOF

Actually, i want these bolded statements in File1.sh as it.

But after first EOF, contents are not written in Firle1.sh any more.

Is there any solution ?
# 2  
Old 07-04-2008
Hi,

Since you have two labels(here document), both named as EOF it will create some problem. Try the below,

Code:
cat > File1.sh <<EOA

set feedback off
set serveroutput on

cat > File2.sh <<EOF
contents of second file
EOF
Contents of First file

EOA

I don't really understand your actual scenario. I hope the above may help.

Regards,
Chella
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Problem creating a makefile

hello, I'm trying to create a makefile to run multiple c files. I am able to run one c file only with the code I have when I tried to run 2 or more c files I'm not able. here is my code # $Source: /home/hectormasencio/make/Makefile,v $ # $Date: 2012/11/27 11:35:30 $ CC= gcc OBJS= temp.o... (3 Replies)
Discussion started by: Hector M.
3 Replies

2. UNIX for Dummies Questions & Answers

Problem in creating CSV file

Hi guys, I am not experienced with Unix, so please dont mind if the question seem to be irrelevant. I have written a simple script, that connects DB & fetches few records from a table. I wanted to get those details as file in .CSV format via mail. -I stored the query o/p in a file. -I... (6 Replies)
Discussion started by: sumitburnwal88
6 Replies

3. Shell Programming and Scripting

Problem with array and creating directories

I have an interesting requirement. I have declaried an array like :- arr=`find . ! -name "." | xargs -I {} echo {} | cut -c 2-${#}` Then i will try to access the array elements like :- i=0 for i in ${arr}; do Here comes the confusions, the array elements are basically dir and files stored... (2 Replies)
Discussion started by: Renjesh
2 Replies

4. UNIX for Dummies Questions & Answers

EOF problem with Cron Job?

Hey guys... first post here... I have set up the following cron to create daily backups for me and rotate them weekly: date=`date +%d`; tar -zcvf /home/mysite/backups/backup_dev_$date.tgz /home/mysite/public_html/dev/app --exclude=/home/mysite/public_html/dev/app/tmp However, I keep... (4 Replies)
Discussion started by: Crazy Serb
4 Replies

5. Shell Programming and Scripting

EOF problem

hi i am trying to connect to database by two method one is sqlplus fss_blf/fss_blf@schema1 >select * from schema1_ta_example exit above method succesfffuly connect it to dabase but the problem comes when i try to enter this code into mine shell script by using EOF character it is... (4 Replies)
Discussion started by: aishsimplesweet
4 Replies

6. Shell Programming and Scripting

confused with << EOF EOF

Hi friends , I am confused with << EOF EOF Most of the cases I found sqlplus $db_conn_str << EOF some sql staments EOF another exapmle is #!/bin/sh echo -n 'what is the value? ' read value sed 's/XXX/'$value'/' <<EOF The value is XXX EOF (1 Reply)
Discussion started by: imipsita.rath
1 Replies

7. UNIX for Dummies Questions & Answers

Problem when creating VMHost with dd

Hi, I have to create a VMhost from a server an I am doing this by using two Knoppix live CD'R's and conencting the VMhost machine to the server via switch. On in the original server and one in the VM HOST and I copy the drive over from the original server using the dd comand. When determing how... (1 Reply)
Discussion started by: mojoman
1 Replies

8. Solaris

problem in creating flash archive

Dear all I am in a problem. I have created a master server on which I have install a Solaris 10 OS as well as Oracle 10g with some additional solaris packages. Now I want to create a flash archive of this server and install that flash archive on another server, so that the new server will have... (6 Replies)
Discussion started by: girish.batra
6 Replies

9. Linux

Problem with creating big files

Hi... I have a very wired problem with my redhat4 update 4 server... Every time i create a file bigger then my physical memory the server kills the process\session that creates the file, and in the "messages" file i see this error: "Oct 21 15:22:22 optidev kernel: Out of Memory: Killed process... (6 Replies)
Discussion started by: eliraza6
6 Replies

10. AIX

problem with expect eof

hi guys i have such simple script, which i'm executing on AIX 5.3 #!/usr/local/bin/expect spawn passwd exptest set password 123 expect "*password:*" send "$password\r" expect "*password again:*" send "$password\r" expect eof the output is following: spawn passwd exptest sh:... (4 Replies)
Discussion started by: zoom
4 Replies
Login or Register to Ask a Question