How do I recover from invalid rc.conf file

I'm experimenting with FreeBSD in a virtual machine and attempted to clear the console screen after the system boots by adding "exec clear" to the end of /etc/rc.conf Now, my system load and I can't login. I receive the following message:
Code:
exec: clear: not found
Enter full pathname of shell or RETURN for /bin/sh:

How do I recover from my mistake? I can't login and don't have access to modify that file.
 
I need more learning time to be nasty. vi will suffice for now.

Thanks, you solved my problem.
 
Couple of notes about what you did here.

First, commands should not be put into rc.conf. It should only be used for defining variables.
Second, clear is a shell builtin. So exec clear isn't going to work as there is no binary by that name.
 
I seem to recall that using vidcontrol(1) to change video modes would put the cursor at the top, & the allscreens_flags="MODE_NNN" would do similarly. Setting rc_startmsgs="NO" in /etc/rc.conf might suppress those last few output lines. I don't know if there's a better/canonical way, though.

What gordon@ says is very true, rc.conf is read early enough in the booting process that any spurious commands are processed long before they would be of use if they worked in any case.
 
Back
Top