LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   Trouble with kickstart file's post script section (https://www.linuxquestions.org/questions/red-hat-31/trouble-with-kickstart-files-post-script-section-4175438034/)

FatKang 11-20-2012 06:04 PM

Trouble with kickstart file's post script section
 
Hello everyone,

I've been working on a script that generates a kickstart file for RHEL 6.3. Everything seems to work correctly except for an issue with the %post ..... %end section. It seems that if I have a section that’s utilizes cat and EOF it ignores the EOF. Please see the example below.


Code:

%post

cat << EOF >> /etc/passwd
user1:x:1000:1000::/home/user1:/bin/bash
......................
......................
......................
EOF

cat << EOF >> /etc/shadow
user1:fsdfsdf#@$$@324fdsfsgs1233:15658:0:99999:7:::
......................
......................
......................
EOF

......................
......................
......................

%end

What I would expect to happen would be that the above would be appended to passwd and shadow. However, what I end up with is all of the above including the ending EOFs in passwd. I'm not clear as to why this is occurring. I've tested the above script in a bash script run on a local machine without issue.

Any direction would be much appreciated.

kankan55 11-21-2012 05:22 AM

could you try this

cat >> myfile << EOF
my text
EOF

Kan

FatKang 11-30-2012 09:41 AM

Cool,

That did the trick.... guess it helps if I flow things in the right direction! ;p

- FatKang


All times are GMT -5. The time now is 10:40 PM.