PDA

View Full Version : How the Hell do you"Comment Out"of something?



groundhog
06-11-2002, 01:40 AM
You'd think that I would know this by now. I don't so I'm asking it in the newbie area. Is commenting out the same thing as putting like a # before a command line so that the line no longer does what it was supposed to do?

More specifically, I'm trying to block a the service update on a DSR6K.


What would I have to do to these areas of rcsysinit to "Comment out" of them?



code:--------------------------------------------------------------------------------#echo "Check for PROM update ..."
#if [ "$updateprom" = true ]; then
# if [ -e /prom/TiVoProm.bin ]; then
# osdwriter /tvbin/InstallingSoftware.$TV_STD.cs22
# getprom -Update /prom/TiVoProm.bin
# echo "Sleep...waiting for reboot"
# osdwriter /tvbin/PromScreen2Version7.$TV_STD.cs22
# sleep 1000000
# restart
# fi
# echo "Can't find PROM image"
#fi--------------------------------------------------------------------------------



And here's the one SZ referred to:


code:--------------------------------------------------------------------------------#if [ "$upgradesoftware" = false ]; then
# echo "Not upgrading software"
#else
# TODO... Find another way to do this...
#tivosh /etc/rc.d/finishInstall.tcl
#export -n EMERGENCY_REINSTALL
#fi

BubbleLamp
06-11-2002, 11:03 AM
They are already commented out. That's exactly what the # does.

groundhog
06-11-2002, 05:25 PM
O.K. Thanks. That's what I thought. I did a lot of searching and couldn't confirm exactly what "Comment Out" meant.

chipster
06-11-2002, 09:05 PM
The "#" in front of a line tells the Tivo software to ignore that line (except for the very first line in a script).

Good software engineers use this to insert comments about what the code is doing - so people who read the code will understand what's going on.

We use the term "Comment Out" - to place the comment character in front of a line so that it doesn't get executed.

groundhog
06-12-2002, 12:13 PM
Thanks for the explaination, Chipster.

I assume that based on that explaination, that anything after the # means nothing to the Tivo. The reason that I ask is that some of the line in the code already had a # before them. As a result, I put in an extra # (so some of the lines had ##, instead of a single #). Anyway, the Tivo still boots and works fine, so I assume all is well.

chipster
06-12-2002, 04:37 PM
Indeed, many of Tivo's original scripts as well as rc.sysinit have commented lines to explain what the software is doing, and in some cases they've "commented out" code (last minute changes, etc).

You need not add an additional "#" - but it doesn't hurt either. Tivo already ignores any line that begins with "#" - except the very first line of a script which starts with #! (pound-exclamation - this is a special case).