Red Hat Bugzilla – Bug 88783
Extra Carriage Returns on %post commands
Last modified: 2007-04-18 12:53:01 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Description of problem:
When using commands like this in my ks.cfg file in the %post section
echo "cd /tmp" > /etc/rc.d/rc.local
echo "wget http://192.168.0.1/config.sh" >> etc/rc.d/rc.local
The file in the /etc/rc.d/ directory looks like this.
[root@wpc004 rc.d]# ls -al
drwxr-xr-x 10 root root 4096 Mar 25 19:57 .
drwxr-xr-x 79 root root 8192 Apr 14 12:28 ..
-rwxr-xr-x 1 root root 220 Jul 11 2001 rc.local
-rwxr-xr-x 1 root root 65 Jul 11 2001 rc.local?
It has added a ? sometimes this also appears as a \r
Version-Release number of selected component (if applicable):
kickstart install program
Steps to Reproduce:
1. Create a boot floopy and a ks.cfg file for the kickstart
2. Add the 2 echo lines %post section
3. Boot server and look at /etc/rc.d/rc.local? when finished kickstart
Actual Results: creates the extra lines \r on each line
Expected Results: file just called rc.local
This is actually from an example at
# add comment to /etc/motd
echo "Kickstart-installed Red Hat Linux `/bin/date`" > /etc/motd
# add another nameserver
echo "nameserver 10.10.0.2" >> /etc/resolv.conf
Did you edit the ks file under windows at anytime?
It worked fine for me when I tested your example.
Yes it was edited under windows and thinking this caused the
problem moved back to linux ( copying the file not re-creating though )
Could the Windows sessions have added this ?
Thanks for the comments.
Windows applications generally terminate a line with CR/LF, so yes thats
probably the problem.